Reputation: 11
I wrote an optimization function in Julia 0.4 and I want to call it from Python. I'm storing the function in a .jl file in the same working directory as the Python code. The data to be transferred is numeric, and I think of using Numpy arrays and Julia arrays for calls. Is there a tutorial on how to make this work?
Upvotes: 1
Views: 591
Reputation: 3738
In my experience, calling Julia using the Python pyjulia package is difficult and not a robust solution outside HelloWorld usage.
1) pyjulia is very neglected.
There is practically no documentation aside the source code. For example, the only old tutorials I've found still use julia.run() that was replaced by julia.eval(). pyjulia is not registered on PyPI, the Python Package Index. Many old issues have few or no responses. And buggy, particularly with heavy memory usage and you could run into mysterious segfaults. Maybe, garbage collector conflicts...
2) You should limit pyjulia use to Julia functions that return simple type
Julia objects imported to python using pyjulia are difficult to use. pyjulia doesn't import any type constructors. For example, pyjulia seems to convert complex Julia types into plain python matrix.
3) If you can isolate the software modules and manage the I/O, you should consider the shell facility, particularly in Linux / Unix environment.
Upvotes: 2
Reputation: 36756
Check out the pyjulia module. It allows you make calls to Julia from within Python
Upvotes: 2