hmp.calibrate#

Run a calibration workflow from a TOML file or a validated config object.

Signature#

hmp.calibrate(config, **kwargs) -> Any

Reference#

hydromodpy.calibrate(config, **kwargs)[source]

Run a calibration workflow from a TOML file or config object.

Paths route directly to run_calibration_cli(); in-memory config objects open a lazy Project so run_calibration_programmatic() has the project context it requires.

Return type:

Any

Parameters:

Parameters#

config

Calibration TOML path or validated configuration object.

kwargs

Options forwarded to the underlying calibration runner. The headless keyword controls the project initialization for the in-memory config branch and is ignored for the TOML branch (which builds no project).

Returns#

Any

Calibration report or workflow-specific result.

Raises#

FileNotFoundError

If the calibration TOML path does not exist.

hydromodpy.core.exceptions.ConfigMissingError

If neither config_path nor parameters is supplied.

hydromodpy.core.exceptions.CalibrationError

If the optimizer or objective evaluation fails.

Examples#

>>> import hydromodpy as hmp
>>> report = hmp.calibrate("calibration.toml")  

See Also#

hydromodpy.calibration.cli_runner.run_calibration_cli

TOML entry point used by the path branch.

hydromodpy.calibration.programmatic_runner.run_calibration_programmatic

Python entry point used by the config-object branch.

hydromodpy.calibration.CalibrationReport

Structured calibration result.

param config:

type config:

Any

param kwargs:

type kwargs:

Any

Example#

import hydromodpy as hmp

report = hmp.calibrate("calibration.toml")

See Also#