materialize_candidate#
- hydromodpy.calibration.materialize_candidate(base_config, params, space, out_dir, *, candidate_label=None, iteration_index=None, name=None, workspace_root=None, extra_sections=None, base_dir=None)[source]#
Write a standalone override TOML for one calibration candidate.
- Return type:
Path- Parameters:
Parameters#
- base_config
Path to the target simulation TOML or an in-memory
HydroModPyConfiginstance. When a config object is passed, the overlay is built frommodel_dumpandbase_configin the overlay falls back tobase_dir(when supplied) so the file remains rechargeable.- params
Candidate values keyed by parameter name (must cover every parameter in
spacethat has atargetorpath).- space
Calibration parameter space declaring dotted target paths and per-parameter
mode("replace"/"scale").- out_dir
Directory under which the overlay is written. A
candidate_labeloriteration_indexargument picks the subfolder name.- candidate_label
Filesystem-safe label (e.g.
"truth"). Eithercandidate_labeloriteration_indexmust be supplied.- iteration_index
Iteration number when no explicit label is given. Produces a folder like
iter_0042.- name
Value to write at
simulation.namein the overlay.- workspace_root
Value to write at
workspace.root. Required when the parent simulation TOML does not already declare a workspace root.- extra_sections
Optional mapping of additional TOML sections (e.g.
{"display": {"enabled": False}}) applied on top of the overlay.- base_dir
Reference directory for relative path rewriting. When supplied,
base_configandworkspace.rootpaths inside the overlay are emitted relative to this directory; otherwise absolute paths are written (the historical behaviour).
Returns#
- Path
Absolute path to the written overlay TOML.
- param base_config:
- type base_config:
Path|str|BaseModel- param params:
- type params:
- param space:
- type space:
- param out_dir:
- type out_dir:
Path|str- param candidate_label:
- type candidate_label:
- param iteration_index:
- type iteration_index:
- param name:
- type name:
- param workspace_root:
- type workspace_root:
- param extra_sections:
- type extra_sections:
- param base_dir:
- type base_dir:
Path|None