build_objective_from_config#

hydromodpy.calibration.build_objective_from_config(cfg, *, observed_by_output=None)[source]#

Assemble an Objective from a CalibrationConfig.

Each objective_block becomes one ConfigBlockObjective (metric + normalise + transform applied per block). When a single block is declared, the block is returned directly; otherwise the blocks are wrapped in a CompositeObjective with normalised weights.

A block that inherits a burn-in while consuming an output with no time axis is refused here, by name, rather than scored on a truncated vector.

observed_by_output supplies the observed vector of an output that names a station rather than typing its values: the record is only known once it has been aligned on a trial’s simulated timestamps, so it arrives here instead of being read off the declaration. What it names wins over observed_values; every other output is read from its declaration as before.

Parameters:
Return type:

Objective