-
Notifications
You must be signed in to change notification settings - Fork 0
Python functions in a script do not inherit enclosing scope #3
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
Comments
This issue has been mentioned on Image.sc Forum. There might be relevant details there: https://forum.image.sc/t/running-napari-alongside-fiji/109949/5 |
So I guess you are saying The fact that imported modules are not accessible in methods is more confusing to me. I thought those import statements are included directly in the script passed to the |
@karlduderstadt Yeah, I'm not sure yet what the best solution is. Just wanted to get the issue filed. If anyone wants to chime in about best practices here, it would be helpful. Otherwise, I'll work on this issue as part of rolling out this component to Fiji's new Java-21-based update site, hopefully some time next month. |
Wanted to mention this in relation to why the imported modules are not passed to |
As noted by @ian-coccimiglio here, scripts with functions do not inherit imported modules, nor other globals.
This script fails:
Whereas this script works:
Interestingly, SciJava
#@
variables injected into the bindings are put intolocals()
but notglobals()
, which means they are inaccessible to functions even when theglobal
keyword is used:yields:
So there are maybe two different bugs going on here?
The text was updated successfully, but these errors were encountered: