hydromodpy.core.toml_io.io#
Round-trip TOML helpers powered by tomlkit.
Serialise a HydroModelBase instance to a commented TOML document
filtered by the requested Profile so that
hmp config --profile user emits a user-friendly template and
--profile expert emits the full document.
The helpers here only handle serialisation; loading is covered by
loader.py and HydroModPyConfig.from_toml(). For any fully
resolved config instance:
from hydromodpy.core.toml_io.io import dump_toml_with_comments
dump_toml_with_comments(cfg, "out.toml", profile="expert")
produces a TOML file whose re-load (HydroModPyConfig.from_toml)
yields a config equal to the original.
Functions
|
Serialise model to a TOML document at path. |