hydromodpy.core.config_kit.field_metadata#
Typed convention for Field(json_schema_extra=...) metadata.
The codebase attaches UI hints, calibration bindings, and serialisation flags
through json_schema_extra. This module defines the canonical key set so
typos surface during validation and tooling can rely on a stable contract.
Use field_metadata() when declaring a new Field:
from hydromodpy.core.config_kit.field_metadata import field_metadata
k_aquifer: Annotated[float, Profile.USER] = Field(
default=1e-5,
description="Hydraulic conductivity.",
json_schema_extra=field_metadata(
widget_type="input",
unit="m/s",
display_name_fr="Conductivite hydraulique",
),
)
The helper rejects unknown keys at module import time, catching typos in CI rather than at first JSON schema export.
Module attributes
|
UI widget hint consumed by the Streamlit/React frontend. |
|
Maturity tag attached to a field. |
Functions
|
Build a validated |
|
Return True when payload only contains canonical keys. |
|
Return the set of keys in payload that are not canonical. |
Classes
|
Canonical schema for |