NGEET / fates

repository for the Functionally Assembled Terrestrial Ecosystem Simulator (FATES)
Other
105 stars 92 forks source link

Add some python module error checking to the python tools #1076

Open ekluzek opened 1 year ago

ekluzek commented 1 year ago

This comes from my thinking about this issue in CTSM:

https://github.com/ESCOMP/CTSM/issues/2126

In the short term I figure in CTSM we'll add some checking for proper python modules in the CTSM buildnml. But, in the long term it will be good to have this same kind of error checking directly in the python tools for FATES. This is a usability issue for new users to python to tell them why their use of the tool failed.

What this would look like is that each python tool should check that needed python modules that aren't standard are indeed loaded. And if there are version requirements for them make sure the right versions of python and those modules are being used. This could be something that's put in a shared module to be used by several of the python tools. But, it's a good usability thing to always do this sort of thing. For the python version, at minimum you could make sure python 3 is being used, as I'm guessing python-2 would fail. For future planning it's good to know what window of version works for python tools. But, it also takes some work to figure that out. But, then you can at least be aware that updates will have to happen at version X, and plan for that transition.