Skip to content

Commit d193f56

Browse files
author
Christopher Doris
committed
use juliapkg to manage julia dependencies
1 parent 2e14757 commit d193f56

File tree

13 files changed

+121
-786
lines changed

13 files changed

+121
-786
lines changed

python/juliacall/__init__.py

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,42 @@
11
__version__ = '0.5.1'
2-
CONFIG = dict(embedded=False)
3-
from .all import *
4-
from . import init
2+
3+
CONFIG = {}
4+
5+
def newmodule(name):
6+
"A new module with the given name."
7+
from . import Base
8+
return Base.Module(Base.Symbol(name))
9+
10+
class As:
11+
"Interpret 'value' as type 'type' when converting to Julia."
12+
__slots__ = ("value", "type")
13+
__module__ = "juliacall"
14+
def __init__(self, value, type):
15+
self.value = value
16+
self.type = type
17+
def __repr__(self):
18+
return "juliacall.As({!r}, {!r})".format(self.value, self.type)
19+
20+
class JuliaError(Exception):
21+
"An error arising in Julia code."
22+
__module__ = "juliacall"
23+
def __init__(self, exception, stacktrace=None):
24+
super().__init__(exception, stacktrace)
25+
def __str__(self):
26+
e = self.exception
27+
if isinstance(e, str):
28+
return e
29+
else:
30+
from . import Base
31+
io = Base.IOBuffer()
32+
Base.showerror(io, e)
33+
return str(Base.String(Base.take_b(io)))
34+
@property
35+
def exception(self):
36+
return self.args[0]
37+
@property
38+
def stacktrace(self):
39+
return self.args[1]
40+
41+
from .init import init
42+
init()

python/juliacall/all.py

Lines changed: 0 additions & 2 deletions
This file was deleted.

python/juliacall/deps.py

Lines changed: 0 additions & 218 deletions
This file was deleted.

0 commit comments

Comments
 (0)