hmp.export()#
- Command line
hmp export - Returns
PublishedLine - Defined in
hydromodpy/project/api.py
-
export(
) list[Path][source]#*,
-
export(
) tuple[PublishedLine, ...]*,
Export data of a run to files, or deliver what its
[[export]]blocks name.The words of an
[[export]]block and ofhmp export:variablesays what (a name, a list, or"all"),timeorperiodwhen,folderorfilewhere. The format follows the data unlessformator the extension offilenames one. Files land inruns/<run>/exports/and are recorded inexports/index.json.- Parameters:
ref (Ref) – The run: its directory, its name in
workspace, or the run.deliver (bool) – Send what the
[[export]]blocks of the run name, and take no other word.workspace (PathLike | None) – The project directory, or a folder inside it.
environment (Environment | None) – A
folderorfilemust sit under the roots its bounds allow.Nonekeeps the default of the machine, which checks nothing.
- Returns:
list of pathlib.Path or tuple of PublishedLine – The files written, or with
deliverthe delivery lines.- Raises:
hydromodpy.core.exceptions.ExportError – If
variableis missing, ordelivercomes with another word.- Return type:
list[Path] | tuple[PublishedLine, …]
Examples
>>> import hydromodpy as hmp >>> hmp.export("runs/transient_nwt", "all", workspace="~/ws/p") >>> hmp.export(run, deliver=True)
Keyword arguments and command-line flags#
The twin command is hmp export.
| Keyword | Default | Command-line flag | Accepted by |
|---|---|---|---|
time | None | --time | every form |
period | None | --period | every form |
format | None | --as | every form |
folder | None | --to | every form |
file | None | --to | every form |
crs | None | --crs | every form |
resolution | None | --resolution | every form |
layer | None | --layer | every form |
nodata | -9999.0 | --nodata | every form |
deliver | False | --deliver | every form |
workspace | None | -w --workspace | every form |
environment | None | no flag | every form |
Flags of hmp export with no keyword: --list, --regen. To get their effect from Python, build the configuration object with the values you want, or write them in the TOML file.