config#
hydromodpy.config carries the root Pydantic model
HydroModPyConfig that aggregates every TOML section. It is the
canonical configuration contract: anything a user can declare in a
project TOML must round-trip through this model.
Sub-modules#
The config package is intentionally thin. Each section model
lives close to the package it configures (see Add a Config Field
for the table). The composition root sits in
hydromodpy/config/hydromodpy_config.py.
Sections aggregated by HydroModPyConfig#
TOML section |
Pydantic model |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Each model honours the project-wide invariants documented in
Add a Config Field: ConfigDict(extra="forbid"),
Annotated fields with unit aliases and Profile annotation,
Field with description and at least one example.
Key public symbols#
hydromodpy.config.HydroModPyConfigβ root model.HydroModPyConfig.from_toml(path)β TOML loader; resolves relative paths against the fileβs directory and appliesbase_configchains.HydroModPyConfig.model_dump()β canonical JSON dump used byhmp schema export.
Recommended reading path#
hydromodpy/config/hydromodpy_config.pyto see the composition root and thebase_configchain.hydromodpy/core/config_kit/introspect.pyto understand how theProfilefilter walks the model tree.One section model (for example
hydromodpy/physics/flow/flow_config.py) to see the per-field conventions in practice.hydromodpy/schema/export.pyto see what is exported to frontends.
Layer-matrix neighbours#
Allowed targets:
core,schema,config, plus every layer it composes (physics,data,spatial,simulation,solver,calibration,results,display,analysis,workflow).Allowed sources:
schema,results,workflow,cli, and the top-level facade.
The composition root is the only place where the cross-package section types are imported together. Everywhere else, layers refer to their own section model, not to the root.
See also#
Configuration overview β user-facing TOML reference (auto-generated from the same models).
Add a Config Field β step-by-step recipe.
schema β JSON Schema export and partial-field validator built on top of these models.