hydromodpy.spatial.field.core.physical_bounds#

Central registry of physical bounds for HydroModPy parameters.

This table is consulted by field-level and section-level validators so that obviously unphysical values (negative K, Sy > 1, recharge of 100 m/day…) fail fast at config construction, before any solver call.

The registry is indexed by a normalized parameter identifier (lowercased). Each entry states the expected canonical unit and the absolute min/max bounds in that unit. Values are inclusive of both ends.

Example#

>>> validate_physical_value(param_id="K", value=1e-4)
1e-4
>>> validate_physical_value(
...     param_id="K", value=1e4
... )  
Traceback (most recent call last):
    ...
ValueError: hydraulic conductivity (id='K') value 10000.0 outside ...

Notes#

Unit coercion is performed by the caller via hydromodpy.core.units; validate_physical_value only enforces numerical bounds in the canonical unit.

Functions

validate_physical_value(*, param_id, value)

Validate value against the central PHYSICAL_BOUNDS registry.

Classes

PhysicalBound(canonical_unit, lo, hi, label)

One physical-range entry.

Exceptions

PhysicalBoundsError

Raised when a numeric value breaches the central PHYSICAL_BOUNDS.