Coming from version 1#
Version 1 was a set of Python scripts. You built a Watershed object, called add_* and
update_* methods on it, and ran MODFLOW with preprocessing_modflow and processing_modflow.
Version 2 puts the same choices in a TOML file. You run it with hmp run, and every run is
stored in a folder you can read without HydroModPy.
The v1 scripts stay on the tag v1.0.0, and the branch v1.0 is frozen. Nothing forces you to
move a finished study. For a new one, start from A first run.
What changes#
Every setting is a key in a TOML file. There are no setter calls.
A project is a folder with a
project.toml. A run file names it withbase_configand states only what it changes. A loop over a parameter becomes several run files, or a calibration.Results go to
runs/<name>/as Zarr, Parquet and JSON. There is no pickle file to reload.Units are written with the value, as in
"30 m"orunit = "m/s". Version 1 expected meters and days. Version 2 stores SI units, so a v1hkin m/day must be divided by 86400 or written with its unit.Data come from a
[data]table, either from a provider or from your own file.
Keys#
Version 1 |
Version 2 |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
A table of a process now carries kind where an alpha release of version 2 used type. If an
old file does not load, hmp doctor --fix-config rewrites the renamed keys and says what it
changed. The generated reference lists every key: TOML parameters.
Commands#
Version 1 |
Version 2 |
|---|---|
Edit the paths at the top of a script |
|
|
|
|
|
Plot functions of |
|
Reload a pickle of models |
|
Calibration scripts |
|
Copy a folder of results to a colleague |
|
Every command takes -w <workspace>, and prints JSON with --format json. The full list is in
Command line.
Moving a study#
Run
hmp workspace initand put your input files in~/hydromodpy/data/.Write a
project.tomlwith the site, the catchment, the depth and the data. Example 04 shows a whole file, section by section.Run it with a steady regime first. Check the figures, then add the dates and the forcings.
Compare with your v1 results through
hmp diffor a notebook.
Results are not bit for bit equal to version 1. The recharge, the drains and the meshing were rewritten, and each change is in the changelog.