Skip to content

Contributing to quakecascade

Thank you for helping. Bug reports, method questions and merge requests are welcome on the issue tracker.

Development setup

git clone https://gitlab.com/yusufeminoglu/quakecascade.git
cd quakecascade
python -m venv .venv && . .venv/bin/activate      # Windows: .venv\Scripts\activate
python -m pip install -e ".[test,geo,docs]"
python -m pytest

Rules a change must keep

  1. Missing is never zero. A value that cannot be computed is NaN with a status code from quakecascade.contract; a test must show the status for each missing input.
  2. Sourced coefficients. Every number taken from the literature cites author, year and table or equation in the docstring. A coefficient with no citable default is a required argument.
  3. Metric distances. Anything measured goes through quakecascade.crs.require_metric.
  4. Tests first. New behaviour comes with hand-computed or reference-backed tests; CI keeps line coverage at or above 90 %. Tests never touch the network.
  5. Counts sum, intensities do not. Use contract.aggregate with the right rule.

Documentation

The site is built with MkDocs: python -m pip install -e ".[docs]", then mkdocs serve. CI builds it with mkdocs build --strict and publishes it from main. Docstrings follow the NumPy convention:

  • name other objects with Sphinx roles (:func:`run`, :data:`DAMAGE_STATES`) and write equations as :math: roles or .. math:: blocks; the site turns them into links and rendered math (overrides/hooks/griffe_rst.py);
  • document a public module constant with a #: comment directly above it, with its source; the API pages show it with the constant.

Merge requests

Keep one topic per merge request, add a line to CHANGELOG.md under Unreleased, and run ruff check src tests and the test suite before pushing.

Getting help

Open an issue with a minimal example. Method questions (which fragility set, which GMPE) are welcome too; please say which region and building stock you are working with.