How-to Recipes#

This section answers prescriptive questions of the form “I want to add X, where does it go and what contract must I honour?”.

Each recipe lists:

  • the files to create or edit;

  • the contract to honour (Pydantic model, Protocol, registry);

  • the registration mechanism (entry point or in-process call);

  • the test to add and the command to run;

  • the pitfalls that the layer matrix or the linter would flag.

For a deeper code reading, follow the link to the matching Per-Package Reference entry.

Recipes#

Add a solver

Bind a new (process_type, solver_name) pair to a backend adapter and an output extractor.

Add a Solver
Add a process

Introduce a new ProcessSpatial runtime alongside Flow and Transport.

Add a Process
Add a config field

Extend a Pydantic section with a new field, with units and a Profile annotation.

Add a Config Field
Add a data variable

Wire a new family (next to hydrometry, geology, dem, etc.) and its manager.

Add a Data Variable
Add a data source

Plug a new public API or local-file source into an existing data variable.

Add a Data Source
Add a figure

Publish a named figure consumable by Run.plot and the [display] section.

Add a Figure
Add a block HTML report

Compose a static HTML report from reusable blocks, figures, metrics, tables, and artifact links.

Add a Block HTML Report
Add an exporter

Stream catalog rows or per-run payloads into a new file format.

Add an Exporter
Add a test

Pick the right test family and the right pytest marker.

Add a Test
Add a CLI command

Register a new hmp verb under cli/commands/.

Add a CLI Command
Add a calibration method

Plug a new optimizer into the ask/tell engine.

Add a Calibration Method
Build a frontend

Consume the JSON Schema and the partial-validator for any UI (Streamlit, Angular, React, Jupyter widget).

Build a Frontend