and I have a function in Julia which operates on BigFloat array:
function compfunc(A):
...
end
which I import in python via:
from julia import Main
Main.include("myfile.jl")
Main.compfunc(x)
however I get an error
RuntimeError Traceback (most recent call last)
Cell In[16], line 1
----> 1 Main.compfunc(x)
RuntimeError: <PyCall.jlwrap (in a Julia function called from Python)
JULIA: MethodError: no method matching zero(::PyObject)
Looks like a type conversion issue. The language interface packages do not have general ways to convert between arbitrary types among several languages. Each combination must be implemented specifically, and these packages will implement types in the base languages and maybe a standard like NumPy, not arbitrary third-party libraries. JuliaCall/PythonCall allows you to extend its Julia-to-Python type conversion, no idea if PyJulia allows that in either direction. It’s possible to extract gmpy2.mpfr’s data (likely in C) and instantiate a BigFloat on the Julia side, but that’s a lot of work to be done, possibly in all libraries and languages involved because gmpy2 and Julia don’t seem to wrap MPFR the same way (instance-wise vs global precision).