Contributing
Contributions are welcome: bug reports with a reproducing script, test cases, documentation and code. This page covers the workflow and the rules the code base keeps.
Development setup
git clone https://github.com/szaghi/shore.git
cd shore
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev,cad,gui]" # cad and gui only for their tests
make test # the main suite, ~2000 tests
make lint # ruff check + format checkHow features are made
SHORE grows by frozen acceptance specs (ADR 0005):
- A decision record (
docs/adr/NNNN-*.md) states the problem, the options and the decision. - The acceptance spec is written in
tests/spec/(ortests_gui/spec/) before the implementation, in the frozen metrics ofshore.quality, with the cases not yet passing marked@PENDING(strict xfail). Its hash goes intotests/spec/SHA256SUMS. - The implementation makes the cases pass; the only permitted edit to the spec is deleting a case's
@PENDINGline. Changing a threshold or a metric is a re-freeze: a separate, reviewed commit.
python scripts/check_spec.py verifies the hashes; CI runs it. Report verdicts as counts ("13 passed, 0 skipped, 0 xfailed"), not "it passes".
Code conventions
- Ruff (
make fmtfixes,make lintchecks), line length 100. from __future__ import annotationsand full type annotations.- NumPy-style docstrings: they are the Python API reference, generated by
docs/scripts/api_docs.py(make docs-api; CI fails when the generated pages are stale). - Typed exceptions from
shore.exceptions(MeshInputError,ParameterError,MarchingError); no bareException, noprintin library code. - Every state change goes through a
Command(shore.project.commands), so it is journaled, undoable and replayable.
Tests
| Suite | Run | Needs |
|---|---|---|
| main | pytest | [dev] |
| CAD | pytest tests/test_geometry_occt.py tests/spec/test_wing_body.py ... | [cad] |
| GUI | QT_QPA_PLATFORM=offscreen pytest tests_gui --no-cov | [gui], a Vulkan adapter (lavapipe works) |
| docs examples | pytest tests/test_docs_examples.py | extras per script (# requires:) |
New features carry a geometric correctness test, not only an exit-code check. Keep grids small.
Documentation
The site is VitePress (docs/), organised as Get started, Tutorials, Cookbook, Concepts, Reference and Design.
- Tutorial and recipe code lives in
examples/tutorials/andexamples/cookbook/, included into the pages by region, and run bytests/test_docs_examples.py. - Figures are drawn by
docs/scripts/figures/make.pyin a light and a dark variant from one palette (theme.py);make docs-figures. make docs-buildbuilds the site and fails on dead links.
Commit messages
Conventional Commits: type(scope): description, imperative, lower case, e.g. feat(mesh): cluster premeshed wall layers with an absolute first cell. The changelog is generated from them with git-cliff.
Pull requests
- Open a draft early to discuss the approach.
- Every PR passes
make lint,make testandpython scripts/check_spec.py. - User-facing changes update the docs (and an ADR when they decide something).