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¶
- Missing is never zero. A value that cannot be computed is
NaNwith a status code fromquakecascade.contract; a test must show the status for each missing input. - 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.
- Metric distances. Anything measured goes through
quakecascade.crs.require_metric. - 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.
- Counts sum, intensities do not. Use
contract.aggregatewith 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.