hmp.run#
Run a HydroModPy workflow from a TOML path or a validated config object.
Signature#
hmp.run(config, **kwargs) -> Any
Reference#
- 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(orNonewhen nothing was persisted, e.g.dry_run). Overview, calibration, comparison and testbed workflows return their adapterdictsummary.Parameters#
- config
TOML path or validated configuration object.
- kwargs
Runtime options forwarded to the selected workflow. The
headlesskeyword is honored on both branches (path and config object) and controls the underlyingProjectinteractive side effects.
Returns#
- Run or None or dict
Runinstance (orNone) for thesimulationworkflow.dictsummary foroverview,calibration,comparisonandtestbedworkflows.
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.
Example#
See Also#
hydromodpy.calibrate()– dedicated calibration launcher.hydromodpy.overview()– overview workflow launcher.hydromodpy.compare()– comparison workflow launcher.hydromodpy.workflow– workflow dispatcher and pipelines.