opendrift
opendrift copied to clipboard
Add opendrift command line tool for doing a subset of simulations
- opendrift.py: add opendrift command line
- add opendrift.py to setup.py
@vegardb: Let's see if this happens.
Interesting!
This is the tool written by @vegardb for drifty. We have discussed moving it into opendrift for a while, which makes sense. If we constrain ourselves to supporting a limited set of features it should be feasible to make it generic.
Nice!
Maybe replace set_config_override with some config file mechanism, though?
Possibility to do opendrift.py -f <config_file.ini> would be nice.
Yes, I think it should take a template file in yaml or toml, and let the command line override that so that you easily tweak a per-defined simulation. ini should work for the config values, but it has some limitations in data-types and ambiguity that are better specified in json/yaml/toml, which could possibly all be supported.
Yes, I was more thinking of a config-file with both config-settings as well as other things like seeding, readers etc.
And it could very well be e.g. yaml: opendrift.py -f <config_file.yml>
Tests can be added with: https://click.palletsprojects.com/en/8.0.x/testing/, did not look like you already tested this way @vegardb ?
No, no tests so far.
I had earlier in mind that any OpenDrift module could be called the same way as this script, i.e.
>>> openoil.py <options>
>>> leeway.py <options>
I don't know whether that is feasible, or whether it is better than having a dedicated script opendrift.py as here.