run#

hydromodpy.run(config, **kwargs)[source]#

Run a HydroModPy workflow from Python.

Path and config-object inputs converge on the same dispatch. Simulation workflows return a Run (or None when nothing was persisted, e.g. dry_run). Overview, calibration, comparison and testbed workflows return their adapter dict summary.

Return type:

Any

Parameters:

Parameters#

config

TOML path or validated configuration object.

kwargs

Runtime options forwarded to the selected workflow. The headless keyword is honored on both branches (path and config object) and controls the underlying Project interactive side effects.

Returns#

Run or None or dict

Run instance (or None) for the simulation workflow. dict summary for overview, calibration, comparison and testbed workflows.

Raises#

FileNotFoundError

If the TOML path does not exist.

hydromodpy.core.exceptions.ConfigError

If the TOML payload fails Pydantic validation.

hydromodpy.core.exceptions.PipelineError

If a workflow step raises during execution.

hydromodpy.core.exceptions.SolverError

If the configured solver fails to converge or crashes.

Examples#

>>> import hydromodpy as hmp
>>> run = hmp.run("run_transient_nwt.toml", name="baseline")  

See Also#

hydromodpy.project.Project.simulate

Object-oriented form for repeated runs from one project.

param config:

type config:

Any

param kwargs:

type kwargs:

Any