Skip to content

Time dependent stress response seismicity model. A modified effective Coulomb failure model, that calculates earthquake rate as a function of stress loading and model parameter. See Dahm and Hainzl (2022), http://doi.org/10.1029/2022JB024443 and Dahm, Hainzl and Dahm (2022) https://doi.org/10.5880/GFZ.2.1.2022.002 .

License

GPL-3.0, Unknown licenses found

Licenses found

GPL-3.0
LICENSE
Unknown
COPYING
Notifications You must be signed in to change notification settings

torstendahm/tdsr

Repository files navigation

Citations

Dahm, Torsten; Hainzl, Sebastian; Dahm, Roman Albert (2022): Time-dependent stress response seismicity models (TDSR). GFZ Data Services. https://doi.org/10.5880/GFZ.2.1.2022.002 Dahm, Torsten and hainzl, Sebastian (2022): A Coulomb Stress response model for time-dependent earthquake forecasts. Journal of Geophysical Research, Solid Earth, http://doi.org/10.1029/2022JB024443

tdsr

Build Status PyPI version License Documentation

Time dependent stress response seismicity model.

A modified effective Coulomb failure model, that calculates earthquake rate as a function of stress loading and model parameter

$ pip install tdsr

Usage

Usage instructions t.b.a.

import tdsr

Development

If you want to contribute to tdsr, we highly recommend setting up a virtual environment for local development. You can easily do so with pipenv, which can be installed with pip install --user pipenv (instructions) by following the steps below. Note that all commands should be run in the top level directory of the cloned tdsr repository.

$ git clone https://github.com/torstendahm/tdsr.git
$ cd tdsr
$ pipenv install --dev

With the virtual environment set up, activate it with pipenv shell. To exit the virtual environment, run exit.

Testing

Tests are located in the /tests directory. To add a new test, add a file with a function name starting with test. To run the full test suite, run:

$ invoke test
$ pytest # can also directly run pytest with custom options

This will run tests serially and fail on the first error, which is preferred for local debugging. However, this behaviour can also be changed with invoke test --[no-]fail-fast --parallel.

Code style

tdsr provides automatic code formatting and checks code for conformance.

$ invoke format   # format python files
$ invoke lint     # lint python files
$ invoke type-check     # check for mypy typing errors
$ invoke pre-commit     # run all of above checks

To pass CI, ensure that invoke pre-commit passes all checks.

Documentation

Sphinx is used to build the documentation website, which uses reStructuredText (rst). See this website for examples of how to use rst.

To build and preview the documentation locally, you can use

$ invoke docs

This will start a local webserver and open the documentation in the browser for you. If this is not needed, use the --no-serve flag.

Releases

Note: This is only relevant for maintainers.

Given a clean working tree on the master branch, a release of a new version of tdsr to pypi can be triggered by creating and pushing a new git tag.

The github action CICD pipeline will test, package, and publish the new version automatically. Before attempting a new release, please make sure all code checks pass.

We use semantic version strings of the form {major}.{minor}.{patch}. Depending on the type of release, choose the part of the version to be incremented in the command below.

$ bump2version patch
$ git push --follow-tags

Remember to activate the virtual environment as previously outlined if bump2version is not found.

About

Time dependent stress response seismicity model. A modified effective Coulomb failure model, that calculates earthquake rate as a function of stress loading and model parameter. See Dahm and Hainzl (2022), http://doi.org/10.1029/2022JB024443 and Dahm, Hainzl and Dahm (2022) https://doi.org/10.5880/GFZ.2.1.2022.002 .

Resources

License

GPL-3.0, Unknown licenses found

Licenses found

GPL-3.0
LICENSE
Unknown
COPYING

Stars

Watchers

Forks

Packages

No packages published

Languages