Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyjlcallback not defined? #476

Closed
MilesCranmer opened this issue Mar 16, 2024 · 2 comments
Closed

pyjlcallback not defined? #476

MilesCranmer opened this issue Mar 16, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@MilesCranmer
Copy link
Contributor

MilesCranmer commented Mar 16, 2024

In PySR unittests I'm getting the following issue when trying to upgrade to juliacall 0.9.16 (in this PR)

     File "/home/runner/work/PySR/PySR/pysr/sr.py", line 1626, in _run
        bin_constraints=jl_array(bin_constraints),
                        ^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/runner/work/PySR/PySR/pysr/julia_helpers.py", line 33, in jl_array
        return jl_convert(jl.Array, x)
               ^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/juliacall/__init__.py", line 21, in convert
        _convert = PythonCall.seval("pyjlcallback((T,x)->pyjl(pyconvert(pyjlvalue(T)::Type,x)))")
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/runner/.julia/packages/PythonCall/F4kmJ/src/JlWrap/module.jl", line 25, in seval
        return self._jl_callmethod($(pyjl_methodnum(pyjlmodule_seval)), expr)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    juliacall.JuliaError: UndefVarError: `pyjlcallback` not defined

It seems that juliacall.convert is broken.


(Probably a good motivation to add #461 to make sure more of the API is covered by testing)

@cjdoris
Copy link
Collaborator

cjdoris commented Mar 16, 2024

Ah thanks, what a dumb bug (introduced by the refactor). Fixed on main, plus I've added tests for more of juliacall, and making a release now.

@cjdoris cjdoris closed this as completed Mar 16, 2024
@MilesCranmer
Copy link
Contributor Author

Thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants