Closed mcgibbon closed 4 years ago
@nbren12 @rheacangeo @ofuhrer Since this is for running the model and for use by the python version, @oliverwm1 and I have mostly been discussing the design, but if you have requirements for this please share them.
This is a great idea for a package. I would be a fan of a pure yaml front end and a dict + xarray python backend. Also @frodre might be interested since he also has some experience with configuration management.
I’ve had good luck with f90nml for the NGAQUA work. Here is the code I wrote to configure/run SAM: https://github.com/VulcanClimateModeling/uwnet/blob/master/src/sam/case.py
I originally had the ability to run these “cases” using the same object, but that got pretty unwieldy and violated the single responsibility principle.
Apparently Click also has some good integration with yaml configuration. It lets you use a wizard for configuration flags and then save the configuration you made to a yaml file, for example. This would let us have both a yaml and a command-line frontend with pretty seamless integration. I see the command-line frontend being used mostly for testing where we create fairly standard cases that only change a few parameters (like say, run time).
We're definitely past the initial design stage.
This issue should be replaced with sub-issues as we scope out particular features. But for the start, it's good to have a place for over-arching design discussion.
This package is for doing anything you'd need to do to a run directory. It should provide an interface between any new configuration style we want (yaml files, python keyword arguments) and run directories. It should be clear, documented, and narrow in scope (just working on run directories here, workflow tools can import and use this package). Because it is clear and narrow, it should be easy to make it well-tested.
Some features needed:
How to specify run directory configuration is an open design question. A likely option is in dictionaries. You can pass values from a dictionary
config
to a functionfunc
usingfunc(**config)
. yaml files can be loaded into a dictionary. Python code can easily manipulate a dictionary.Namelist manipulation can be done with an existing package, like
f90nml
.