Recipes#

Each recipe answers “I want to add X: where does it go and what contract must I honor?”. It lists the files to create or edit, the contract (a Pydantic model, a Protocol, a registry), the registration, the test to add and the pitfalls the layer matrix or the linter would flag. For a deeper read of the code, follow the link to the matching entry of Packages.

New here? Start with the Quick start.

Extend the code#

Plug into a port

Every port with what a plugin declares, how it registers and the tests that cover it, read from the registries. Start here for a solver, a mesh or terrain engine, a data source, an evaluator, an optimizer, an export format or a figure.

Plug into a port
Add a config field

A field with a unit, a profile and a description. The generated reference documents it from that declaration.

Add a config field
Add a solver

Bind a <process_type>_<name> key to an adapter class that declares its thirteen attributes, and to an output extractor.

Add a solver
Add a process

A new process type next to flow and transport, on the worked example of transport.

Add a process
Add a data variable

A new family next to hydrometry, geology or dem, with its manager.

Add a data variable
Add a data source

A public API or a local-file source for an existing data variable.

Add a data source
Add a figure

A variable, a preset or a panel for Run.figure and the [[display.figure]] tables.

Add a figure
Add a block HTML report

A static HTML report composed of reusable blocks.

Add a block to the HTML report
Add an exporter

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

Add an exporter
Add a CLI command

A new hmp verb under cli/commands/.

Add a CLI command
Add a calibration method

A new optimizer in the ask/tell engine.

Add a calibration method
Build a frontend

The JSON Schema and the partial validator, for any UI.

Build a frontend
Serve over HTTP

The thin HTTP layer of the repository: one space per organisation, one process per run.

Serve over HTTP

Check and ship#

Add a test

The tier, the marker, the fixtures, and the rules for running tests in parallel.

Add a test
Fix a failing architecture gate

What each rule of tests/unit/architecture means and how to satisfy it.

Fix a failing architecture gate
Cut a release

Version, changelog, tag, and what the tag starts.

Cut a release