Skip to main content

tdsr

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tdsr-0.0.8.tar.gz (2.0 MB view details)

Uploaded Source

Built Distribution

tdsr-0.0.8-py2.py3-none-any.whl (37.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file tdsr-0.0.8.tar.gz.

File metadata

  • Download URL: tdsr-0.0.8.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for tdsr-0.0.8.tar.gz
Algorithm Hash digest
SHA256 aa17aa5ed20e41537fb226a978c2e211ed734913791a24794344b9903bef31ea
MD5 714fad004e6e9331e10d6a96d754a3d6
BLAKE2b-256 123f121f20d63b158248ba0efaaebd2f9d37a1e9687ebd0b51a8fb48d09e5f88

See more details on using hashes here.

File details

Details for the file tdsr-0.0.8-py2.py3-none-any.whl.

File metadata

  • Download URL: tdsr-0.0.8-py2.py3-none-any.whl
  • Upload date:
  • Size: 37.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for tdsr-0.0.8-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0a5ab3bd71e5e95b8f7ea7e87d826570a8788e33380f362c73ff8c4620dca101
MD5 fa3b99ca6a68589a33d73dd68f9d573c
BLAKE2b-256 b2c88eea857c487ba14f7dbdb2baebf25f5af1d454b942a76f193671752b534f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page