LDEO-CREW / Pythonic-DISORT

Discrete Ordinates Solver for the (1D) Radiative Transfer Equation in a single or multi-layer plane-parallel atmosphere. Coded entirely in Python 3. Based on Stamnes' FORTRAN DISORT (see references in the Jupyter Notebook) and has its main features.
https://pythonic-disort.readthedocs.io/en/latest/
MIT License
11 stars 2 forks source link

Cannot run the example/test notebooks #11

Closed simonrp84 closed 1 month ago

simonrp84 commented 5 months ago

Hello, I have installed Pythonic-DISORT by cloning the repo and running pip install -r all_optional_dependencies.txt

I then tried to run the example notebook 1a_test but get this error:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 2
      1 import PythonicDISORT
----> 2 import disort
      3 import numpy as np
      4 import matplotlib.pyplot as plt

ModuleNotFoundError: No module named 'disort'

The installation went smoothly, so I am unsure why I get this ModuleNotFoundError. Could you please look into it?

dhjx1996 commented 5 months ago

The disort module is the Python-wrapped DISORT. Unfortunately, installation of that module is system-dependent and users will need to separately install FORTRAN compilers. Thus, it is not installed with PythonicDISORT and is in fact not part of PythonicDISORT. If you would like to get that running, however, I will most certainly be happy to help.

The test reference solutions from DISORT have been saved in .npz files in the pydisotest directory though, and so you can run pytest in that directory without needing the disort module.

RobertPincus commented 5 months ago

@simonrp84, @dhjx1996 and I discussed this further, and he may split the notebooks into those doing validation against the Fortran code and those demonstrating the use of PythonicDisort more generally.

simonrp84 commented 5 months ago

Yes, I think that would be a good idea - it wasn't immediately clear to me that those notebooks were for testing rather than as examples for users.

dhjx1996 commented 5 months ago

Sounds good! I will revamp the current test notebooks into examples for users and remove disort4.0.99_f2py and all references to the disort module to avoid licensing issues. I may make some changes to how the tests are conducted but there will still be automated tests at the very least.

dhjx1996 commented 4 months ago

I have removed disort4.0.99_f2py from both the repository and the entire repository history. I have kept the .npz reference solutions in the repository but greatly reduced their size. These changes are not final, but at least now the Jupyter Notebooks should all run regardless of whether a F2py-wrapped Stamnes' DISORT is installed.

dhjx1996 commented 1 month ago

The test suite may undergo further changes but the initial problem has been resolved.

simonrp84 commented 1 month ago

Apologies for not closing this myself, thanks for the work on it.