Skip to content

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 ​

bash
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 check

How features are made ​

SHORE grows by frozen acceptance specs (ADR 0005):

  1. A decision record (docs/adr/NNNN-*.md) states the problem, the options and the decision.
  2. The acceptance spec is written in tests/spec/ (or tests_gui/spec/) before the implementation, in the frozen metrics of shore.quality, with the cases not yet passing marked @PENDING (strict xfail). Its hash goes into tests/spec/SHA256SUMS.
  3. The implementation makes the cases pass; the only permitted edit to the spec is deleting a case's @PENDING line. 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 fmt fixes, make lint checks), line length 100.
  • from __future__ import annotations and 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 bare Exception, no print in library code.
  • Every state change goes through a Command (shore.project.commands), so it is journaled, undoable and replayable.

Tests ​

SuiteRunNeeds
mainpytest[dev]
CADpytest tests/test_geometry_occt.py tests/spec/test_wing_body.py ...[cad]
GUIQT_QPA_PLATFORM=offscreen pytest tests_gui --no-cov[gui], a Vulkan adapter (lavapipe works)
docs examplespytest tests/test_docs_examples.pyextras 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/ and examples/cookbook/, included into the pages by region, and run by tests/test_docs_examples.py.
  • Figures are drawn by docs/scripts/figures/make.py in a light and a dark variant from one palette (theme.py); make docs-figures.
  • make docs-build builds 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 test and python scripts/check_spec.py.
  • User-facing changes update the docs (and an ADR when they decide something).

Released under the MIT License.