hydromodpy.spatial.mesh.cartesian_grid.sgrid_config#

Pydantic configuration model and TOML helpers for structured grid generation.

Design choices#

  • SGridConfig is the only validation entry point for grid settings.

  • Runtime code receives a fully validated object and never re-validates business rules.

  • TOML/mapping loaders both normalize paths and produce the same model.

Module attributes

BottomConfig

Discriminated union of bottom-surface generation methods.

LayeringConfig

Discriminated union of vertical-layering methods.

Functions

load_sgrid_toml(config_path)

Load and validate SGrid configuration from TOML.

validate_sgrid_config_data(config_data)

Validate and normalize SGrid configuration mapping.