Thanks for your interest in sp_validation! This guide covers how to set up a
development environment, run the tests, and propose changes.
By participating you agree to abide by our Code of Conduct.
sp_validation depends on a large scientific stack (treecorr, pyccl,
pymaster, healpy, …). The simplest, most reproducible way to develop is
inside the project container, which ships the full stack pre-built.
# build a writeable sandbox from the published image
apptainer build --sandbox sp_validation docker://ghcr.io/cosmostat/sp_validation:develop
apptainer shell --writable sp_validationThe image is rebuilt and pushed on every push to develop (see
.github/workflows/deploy-image.yml), so
:develop always tracks the latest integration branch.
If you prefer a local environment, use uv:
uv venv && source .venv/bin/activate
uv pip install -e '.[develop]' # runtime + test + docs dependenciesNote that some dependencies (e.g. pymaster) compile C extensions and need a
toolchain (autoconf, automake, libtool, pkg-config) available.
pytest # full suite
pytest -m "not slow" # skip the slow tests
pytest src/sp_validation/tests/test_cosmology.py::test_name # a single testTests live in src/sp_validation/tests/. The default options (configured in
pyproject.toml) collect from there and report coverage. CI runs this suite
inside the freshly-built container image before publishing it, so a failing
test blocks the image push.
We use ruff for linting and import sorting,
with a line length of 88:
ruff check # report issues
ruff check --fix # auto-fix what it canPlease run ruff check before opening a pull request.
- Branch off
develop(the integration branch —masteris no longer used):git checkout -b feature/my-change develop. - Make your change with focused, clearly-described commits.
- Add or update tests when you change behaviour, and run
pytest+ruff check. - Open a pull request into
develop. CI must pass (the container image builds and the test suite runs) before merge.
For larger or analysis-affecting changes, open an issue first so we can discuss the approach.
API documentation is built with Sphinx and deployed to
GitHub Pages from develop. To
build it locally:
uv pip install -e '.[docs]'
sphinx-apidoc -t docs/_templates -feTMo docs/source src/sp_validation
sphinx-build -b html docs/source docs/_build