-
-
Notifications
You must be signed in to change notification settings - Fork 68
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
Error when using require-python
from a required namespace (specifically numba)
#213
Comments
This is hard to say without looking at some more code. What I can tell you is that |
Here's the specific code, which fails depending on how I evaluate:
OK; Interesting. Any idea why this error would only crop up when required from a secondary/dependent namespace, but not when evaluated directly? Just for additional context, the code all works when I directly evaluate the |
It is really tough to debug this as we don't know which specific require is causing the drama. It is happening during the scan-metadata phase of require-python so there must be some issue with scanning a given module more than once. One work-around is to not use require-python but to use raw calls using the base python api. Another would be to statically generate bindings to those modules offline and use the static classes. Aside from that we would need to know exactly which module is getting irritated when we are scanning its attributes and sub-objects. We are doing a lot of magic in require-python - static code generation is a more conservative route which uses the same metadata system and then using the base python api via libpython-clj2.python is the most conservative route. |
Yeah very interesting. I wouldn’t mind diving into this a bit more to see
if it’s a libpython-clj stability issue if you're willing to be a bit
patient, Chris S. We can take it offline if there’s anything sensitive.
I’ll take a look at the repo you mentioned and see if anything stands out.
…On Sat, Sep 3, 2022 at 6:58 PM Chris Nuernberger ***@***.***> wrote:
It is really tough to debug this as we don't know which specific require
is causing the drama. It is happening during the scan-metadata phase of
require-python so there must be some issue with scanning a given module
more than once.
One work-around is to not use require-python but to use raw calls using
the base python api. Another would be to statically generate bindings to
those modules offline and use the static classes
<https://clj-python.github.io/libpython-clj/libpython-clj2.codegen.html#var-write-namespace.21>.
Aside from that we would need to know exactly which module is getting
irritated when we are scanning its attributes and sub-objects.
We are doing a lot of magic in require-python - static code generation is
a more conservative route which uses the same metadata system and then
using the base python api via libpython-clj2.python is the most
conservative route.
—
Reply to this email directly, view it on GitHub
<#213 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACPJX4673COPMBWM5PU7CULV4PJXVANCNFSM6AAAAAAQEBKDQU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
@metasoarous one more quick question-- are you running in embedded mode? If not, would you be willing to try? It tends to be all around more stable than kicking off from Clojure |
Again, thank you both for your time! I'm not running in embed mode, but I'd be willing to give that a shot. I'll also take a look at compiling to static classes. There's nothing sensitive here. The example repo I created is a minimalish extraction of the relevant code in https://github.com/compdemocracy/polis-analysis, so it's all nonprofit/oss :-) Just thinking out loud a bit: I wonder if this might be specifically related to numba, which is required for implementing custom umap metrics. It seems to be a bit hairy in places, and gave me some hell on the dependency side of things just getting the python environment all set up (in particular, was somehow not installable on the |
require-python
from a required namespace (specifically numba)
I tried splitting up calls to I updated my reproduction repo ( |
One thing to keep in mind is that the |
Will take a look today and see if I can spot anything |
@metasoarous did you happen to see this? #194 (comment) Found a possible instability when using lower level libpython-clj import functions |
I'm trying to create a namespace that initializes the python connection, and goes on to define some analytic functions which can then be required from other namespaces. If I evaluate this namespace in the REPL, everything works fine. However, when I try to require this namespace from another I get
TypeError: must be real number, not Float
.Click for stacktrace details
I set up a basic reproduction of this error at https://github.com/metasoarous/libpython-require-error in the
require-init-bug
branch (you'll note that this is the same repo as I put together for #212, only I switched to jdk-8 to get baseline functionality working again).Any idea why I'm seeing this behavior, and if so how I might avoid it?
The text was updated successfully, but these errors were encountered: