Skip to content

Contributing

Run development work from a repository checkout. Follow the installation guide, then install development dependencies:

uv sync --group dev
uv run prek install

Code conventions

Use the existing module layout and NumPy-style docstrings. Explain parameters, units, returned values, and meaningful algorithm conventions. Keep helpers and state limited to what the calculation needs. The controlled acquisition format is the input contract; support additional formats only when explicitly required.

Core processing belongs in src/opm_processing. Simulations, experiments, and figure generators belong in scripts/, with a clear opening docstring and module imports. Generated reports, figures, and temporary acquisitions belong under ignored diagnostics/ or pytest temporary directories.

Validate changes

uv run prek run --all-files
uv run pytest --strict-markers
git diff --check

Tests must be numerical unit tests or simulated disk-to-disk integration tests. Use the testing guide for CUDA selection and physical acceptance. Run performance measurements outside pytest and record the conditions and comparison baseline in ignored diagnostics/. Deskew, fusion, and deconvolution optimizations must retain their stated geometry and numerical behavior.

Prek runs Ruff linting and formatting, spelling, project metadata validation, and GitHub Actions validation. The same hooks run on pushes and pull requests. Ruff follows the MERFISH repository's rule families, with NumPy docstrings required here. Automatic fixes use Ruff's safe fixes.

Pull requests

New pull requests automatically become drafts. Mark a PR ready for review when it is ready to run the CPU suite on Ubuntu and Windows. Further commits to a ready PR rerun the tests; draft PRs run only prek and documentation checks. CPU tests also run on main, release tags, and manual workflow runs.

To create a draft directly from the command line:

gh pr create --draft

Documentation

Update command references when options change and method pages when numerical behavior changes. Keep audit notes and experiment reports in ignored diagnostics/. Keep the README focused on installation and a first workflow; put user and developer guides in the site. See building documentation.