hydromodpy.core.workspace.workspace_toml#

workspace.toml template generator and Pydantic validator.

The workspace-level metadata file workspace.toml lives at the root of every HydroModPy workspace. It carries the research-thematic identity of the collection of projects below it: contact, geographic scope, team, license. The contents are intentionally minimal (~20 lines) and meant to be edited by the user once at workspace creation time.

A Pydantic v2 model validates the file at load time so a hand-edited workspace.toml that breaks the contract surfaces a clear error before producing crashes later in the pipeline.

Specification: reports_db/99_master.md §5.4.

Functions

load_workspace_toml(workspace)

Load and validate <workspace>/workspace.toml via Pydantic.

render_workspace_toml(*, project_name, ...)

Return the rendered workspace.toml content as a string.

write_workspace_toml(workspace, *, ...[, ...])

Write the workspace metadata TOML at <workspace>/workspace.toml.