-
Notifications
You must be signed in to change notification settings - Fork 115
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
Improve error handling on importing modules for GAMMA #325
Comments
Thanks a lot @caitlinadams. I am sure the GAMMA module needs a refresh. I haven't worked with it for about two years and pyroSAR does not support the latest versions. We have recently obtained a new version and so I will also update pyroSAR to be able to use it. Another related issue is #313 opened by a colleague of mine. So, you are very welcome to provide the fix you suggest above if you find the time. I agree with your suggestion. However, I could imagine that you run into more errors after this. |
No problem, @johntruckenbrodt -- I'm happy to collaborate on the refresh as I can while getting pyroSAR working with our GAMMA version. In the end, I figured out that GAMMA couldn't find some key shared objects for FFTW3 and GDAL, and we solved the import errors by creating symlinks to those objects on our supercomputer. Specifically, the issue was that we couldn't actually run the gamma binaries:
If this error had been surfaced by pyroSAR, it would have really helped us with debugging, so perhaps its a matter of displaying any unresolved errors to the user? I found the following code helpful with my debugging, which basically can be used to test if the binary can be run (the output should contain a usage statement if it worked):
We're using |
Thanks Caitlin, that's a very good point. These issues with the shared objects are common and it sure would be good to forward any errors to pyroSAR. The parser raises an error when a GAMMA command raises an error but this error is caught in |
I'm still working through getting pyroSAR working with our GAMMA installation. One thing I've noticed is that despite having DISP in the GAMMA directory, pyroSAR hasn't created a module for it in my
~/.pyrosar/gammaparse
folder (I have yet to investigate this further). As such, I'm getting non-intuitive errors when trying to use the GAMMA functions.Specifically, I believe this is because the error handling on the import statement in the GAMMA utils python file is failing silently:
I confirmed this by running
from pyroSAR.gamma.api import diff, disp, isp, lat
, which producesconfirming that the disp module is the issue. However, this means that
isp
never gets imported, and future calls toisp
fail, even if disp is not required (which is the case forconvert2gamma
). I confirmed this by runningfrom pyroSAR.gamma.api import diff, isp, lat
which works correctly, allowing me to rundir(isp)
and see the module contents.I believe this is related to #85 -- my enhancement suggestion would be to catch each module import error and let the user know which module failed to import. That way, they can at least be pointed to the problematic module, rather than one that is working (but appears later in the import list).
which operating system are you using?
Rocky Linux release 8.10 (Green Obsidian)
which environment is pyroSAR running in?
Micromamba environment
which version of pyroSAR are you using?
conda forge (pyrosar=0.23.0 in environment.yml file)
which function of pyroSAR did you call with which parameters?
convert2gamma
The text was updated successfully, but these errors were encountered: