Metadata-Version: 2.4
Name: esi-utils-rupture
Version: 1.0.9
Summary: USGS Earthquake Impact Utilities for Ruptures
Author-email: Eric Thompson <emthompsone@usgs.gov>, Bruce Worden <cbworden@contractor.usgs.gov>, Gabe Ferragut <gferragut@usgs.gov>
License-Expression: CC0-1.0
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: decorator>=5.1
Requires-Dist: defusedxml>=0.7.1
Requires-Dist: esi-extern-openquake>=1.0.0
Requires-Dist: esi-utils-time>=1.0.0
Requires-Dist: esi-utils-vectors>=1.0.0
Requires-Dist: h5py>=3.7
Requires-Dist: numpy>=1.26
Requires-Dist: obspy>=1.3.0
Requires-Dist: openquake.engine>=3.23
Requires-Dist: numba
Requires-Dist: pandas>=1.0
Requires-Dist: psutil>=5.9
Requires-Dist: pyproj>=2.6.1
Requires-Dist: requests>2.28
Requires-Dist: toml>=0.10
Requires-Dist: h3
Requires-Dist: setuptools<82
Provides-Extra: dev
Requires-Dist: build>=0.7.0; extra == "dev"
Requires-Dist: black>=21; extra == "dev"
Requires-Dist: flake8>=3.9; extra == "dev"
Requires-Dist: ipython>=7.26; extra == "dev"
Provides-Extra: test
Requires-Dist: pytest>=6.2; extra == "test"
Requires-Dist: pytest-cov>=2.12; extra == "test"
Requires-Dist: pytest-console-scripts>=1.2; extra == "test"
Requires-Dist: vcrpy>=4.1; extra == "test"
Provides-Extra: build
Requires-Dist: build; extra == "build"
Requires-Dist: packaging>=24.2; extra == "build"
Requires-Dist: twine; extra == "build"
Requires-Dist: check-wheel-contents; extra == "build"
Dynamic: license-file

# esi-utils-rupture

## Introduction

Utility package with some helper functions for representing ruptures and computing
rupture distances used by USGS earthquake hazard products such as ShakeMap and gmprocess.

See tests directory for usage examples.

## Installation

Isolating installations with virtual environments to prevent dependency conflicts is recommended.  You can use the Python3 [`venv`](https://docs.python.org/3/library/venv.html) module or [`conda`](https://docs.conda.io/en/latest/miniconda.html), which is shown below.

Create and activate the virtual environment, checking that the chosen Python version is compatible with package requirements

```bash
conda create --name rupture python=3.10
conda activate rupture
```

### From PyPi

The easiest way to install the package is via PyPi. For users interested in a more hands on development environment, instructions for a source installation with optional additional dependencies for development and testing further down.

```bash
pip install esi-utils-rupture
```

### From Source

First clone the repostory locally

```bash
git clone https://code.usgs.gov/ghsc/esi/esi-utils-rupture.git
cd esi-utils-rupture
```

Next, install the code with pip

```bash
pip install .
```

Note that this will install the minimum requirements to run the code.
There are additional optional packages that can be installed that support running the unit tests (`test`), code development (`dev`), and building wheels (`build`).
To install these, you need to add the relevant option in brackets:

```bash
pip install .[test,dev,build]
```

For developers, it is also convenient to install the code in "editable" mode by adding the `-e` option:

```bash
pip install -e .[test,dev,build]
```

## Tests

If you are installing from soruce and included the optional `test` dependencies in the install step, then you can run the unit tests in the root directory of the repository:

```bash
pytest .
```
