Contributing¶
Contributions are easiest to review when physics logic, runtime orchestration, and documentation stay cleanly separated.
Repository conventions¶
- Keep reusable simulation logic in
polarism/. - Do not mix physics kernels with scheduler-specific boilerplate unless the boundary is explicit.
Code quality expectations¶
- Add or update type hints on public code.
- Keep docstrings accurate for the generated Python API reference. Update the
hand-written pages in
docs/api/when options or behavior change. - Prefer extending factories and registries over hard-coding new branches into unrelated modules.
- Validate numerical changes with at least the default pytest suite, and use the compliance suite when solver behavior is affected.
Branches and releases¶
masterholds released code only. Every merge intomasteris a release.devis the integration branch. All work lands indevfirst, through short-lived feature branches or direct commits.- Pull requests into
mastermust come fromdev; the release workflow rejects any other source branch.
To release:
- On
dev, set the new version in bothpyproject.tomlandpolarism/__init__.py(__version__). The two values must match. Also updateversionanddate-releasedinCITATION.cff. - Open a pull request from
devintomaster. The release workflow fails if the versions differ or if the tagv<version>already exists. - Merge the pull request. The release workflow runs tests, builds the sdist
and wheel, publishes distributions to PyPI through Trusted Publishing,
creates the tag
v<version>with a GitHub release, and deploys the documentation site to GitHub Pages. Thepypienvironment and repository workflow must be configured as a trusted publisher on PyPI.
Documentation workflow¶
Create an environment and install the development extra:
Run the default CPU-oriented tests with .venv/bin/pytest -q. On CUDA hardware,
use .venv/bin/pytest -q --use-gpu for GPU-marked tests. The
Testing and CI page has the complete CPU/GPU command.
Preview the site locally with:
Before opening a pull request:
Pull request checklist¶
-
Pull requests target
dev; only release pull requests targetmaster. -
The implementation is covered by tests or justified as documentation-only.
- Public symbols have updated docstrings and type hints.
- New options are documented in the user guide or API reference.
- Cluster-specific behavior remains separate from the physics simulation kernel.