hydromodpy.reporting.streamlit_config#

Interactive TOML configuration editor - auto-generated from Pydantic models.

Launch with:

streamlit run hydromodpy/reporting/streamlit_config.py [-- --load config.toml]

Or via the CLI:

hmp config --ui

The interface is entirely derived from Pydantic model metadata (types, defaults, descriptions, Profile, VisibleWhen). Adding or modifying a field in a config model automatically updates the UI - no widget code to maintain.

Features: - Auto-generated widgets for every field type - Conditional visibility via VisibleWhen metadata (no rule duplication) - Real-time Pydantic validation with inline error display - Load an existing TOML for editing - Export to TOML file

Functions

main()

render_model(section_name, model_cls, ...)

Render all visible fields of a Pydantic model.

validate_section(module_name, model_cls, values)

Try to validate values against the model, return error messages.