Skip to content

Contributing and security

Reporting a problem

Use the issue templates. A bug report needs enough to reproduce it: OS, Python version, gragra version (or commit SHA — see Reproducibility and citation), backend, install method, a minimal repro, input shapes, and the expected value with a tolerance. A report about scientific correctness (a suspected wrong sign, a suspected wrong closed-form comparison) should say which Verification claim it contradicts, not just that a number "looks wrong".

Reporting a security issue

Do not open an issue containing sensitive security details. See SECURITY.md for the reporting channel. SECURITY.md's own text is authoritative if this page and it ever disagree.

Development setup

python3.12 -m venv .venv
source .venv/bin/activate
python -m pip install -e ".[dev]"
pytest                                            # default (fast) suite
pytest -m slow                                    # convergence/benchmark tests
pytest --cov=gragra --cov-report=term-missing     # with coverage

Run ruff check . and ruff format --check . locally after source edits.

What continuous integration actually checks

The CI workflow selects its checks from the changed paths. Documentation-only changes run ruff check src, a strict documentation build and tests/test_public_docs.py. All other changes run the default test selection and a strict documentation build on Python 3.11 and 3.12, a single SPECFEM reader test comparing NumPy with numba and with a built C++ extension, and wheel and sdist installation smoke tests. The test jobs install several optional extras, but there are no separate extra-specific jobs and GRAGRA_REQUIRE_EXTRAS=1 is not set, so a test whose optional dependency is unavailable can skip without failing the job. There is no GPU runner: nothing in CI ever exercises the cupy backend, which is why Compute backends states CuPy equivalence as verified on the maintainer's local GPU only.

Documentation conventions

Analytic cross-validation against a closed-form solution is this project's primary test strategy; finite-difference checks are auxiliary (see Analytic benchmarks). New public APIs should follow that pattern where a closed form exists. Executable examples live under docs_site/snippets/ where practical; optional-dependency examples may remain illustrative and are marked accordingly.

Licensing and third-party material

gragra is MIT-licensed (LICENSE). Third-party material used by this documentation site, including MathJax, is attributed in docs/legal/third_party_notices.md.