- Create a virtual env (Python 3.12+),
pip install -e .[dev]. - Enable pre-commit:
pre-commit install. - Run tests:
pytest. - Prefer feature branches and open PRs against
main. - Use Hatch for release validation:
hatch run dev:suiteto mirror the CI command cadence locally.- For release candidates,
hatch clean && hatch buildandHATCH_INDEX=<index> hatch publish(seeAGENTS.md/notes/release_candidate_prep.mdfor the full checklist).
- Document everything:
- Docstrings: Every public module/class/function must ship a NumPy-style docstring with:
- A one-line summary in sentence case.
- Explicit
Parameters/Returns/Raises/Notes(omit the ones you do not need). Document every argument—including units, allowable ranges, defaults, and any coupling to other arguments. For complex payloads (mappings, dataclasses, CLI results) describe the schema: required keys/fields, types, and semantic meaning. - Provenance: cite the dataset, publication, or field trial that backs a productivity/costing helper. When behaviour depends on a CLI flag or workflow sequence, include a short example snippet so Sphinx readers can copy/paste it.
- Return semantics: list the dataclass attributes, tuple ordering, or DataFrame columns along with units. If a function mutates inputs or writes telemetry, state that up front.
- Validation: if you clamp values (e.g., payload multipliers, slope limits), explain the rule so users understand the guard rails.
- Consistency: Module docstrings must explain why the module exists (e.g., Pyomo model
builder, CLI dataset adapter) and link to the relevant docs section. Keep docstrings, CLI help,
and
docs/apinarrative guides in sync—Sphinx renders docstrings verbatim. - Docs build: When adding a new command or helper, update the relevant Sphinx page,
regenerate the API docs, and run
sphinx-build -b html docs _build/html -Wto ensure the new docstrings render cleanly without warnings.
- Docstrings: Every public module/class/function must ship a NumPy-style docstring with: