See the SwarmPAL documentation as well as the development notes on HackMD for development of this package.
Useful references:
This project uses uv for environment and dependency
management and nox as a task runner. Install uv (see the uv
docs), then let nox drive the common tasks — it builds isolated environments for you via
uv, so you don't have to manage them by hand. If you don't have nox installed, uvx nox
runs it without installing.
$ uvx nox -s lint # Run pre-commit (lint + format) on all files
$ uvx nox -s tests # Run the test suite on all installed Python versions
$ uvx nox -s tests-3.10 # Run tests on a specific Python version
$ uvx nox -s docs # Build the docs (fast mode: skips notebook execution)
$ uvx nox -s docs -- --full # Full docs build (executes notebooks + autoapi)
$ uvx nox -s docs -- serve # Build and serve the docs locallyCreate and sync an environment with uv (this reads pyproject.toml and uv.lock and
installs SwarmPAL in editable mode):
uv sync --group test --group apexpy_wheels --extra experimentalDependency groups (dev, test, docs) and optional extras (experimental, dsecs)
are defined in pyproject.toml. The apexpy_wheels group provides prebuilt apexpy
wheels so you don't need a Fortran compiler locally. Run commands inside the environment
with uv run, e.g. uv run pytest.
Run the unit checks with pytest:
uv run pytestTests that reach remote servers (VirES) are marked remote. To skip them:
uv run pytest -m "not remote"Use nox (see above) — uvx nox -s docs for a fast build, or -- serve to preview:
uvx nox -s docs -- serveThis project uses pre-commit for all style checking. While you can run it through nox
(uvx nox -s lint), it's worth installing on its own and enabling the git hook so checks
run automatically on each commit:
uv tool install pre-commit # or: pipx install pre-commit / brew install pre-commit
pre-commit install # install the hook into this repoYou can also run it against all files at any time:
pre-commit run -a