Metadata-Version: 2.1
Name: esi-utils-rupture
Version: 1.0.3
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: License
        =======
        
        Unless otherwise noted, This project is in the public domain in the United
        States because it contains materials that originally came from the United
        States Geological Survey, an agency of the United States Department of
        Interior. For more information, see the official USGS copyright policy at
        https://www2.usgs.gov/visual-id/credit_usgs.html#copyright
        
        Additionally, we waive copyright and related rights in the work
        worldwide through the CC0 1.0 Universal public domain dedication.
        
        
        CC0 1.0 Universal Summary
        -------------------------
        
        This is a human-readable summary of the
        [Legal Code (read the full text)][1].
        
        
        ### No Copyright
        
        The person who associated a work with this deed has dedicated the work to
        the public domain by waiving all of his or her rights to the work worldwide
        under copyright law, including all related and neighboring rights, to the
        extent allowed by law.
        
        You can copy, modify, distribute and perform the work, even for commercial
        purposes, all without asking permission.
        
        
        ### Other Information
        
        In no way are the patent or trademark rights of any person affected by CC0,
        nor are the rights that other persons may have in the work or in how the
        work is used, such as publicity or privacy rights.
        
        Unless expressly stated otherwise, the person who associated a work with
        this deed makes no warranties about the work, and disclaims liability for
        all uses of the work, to the fullest extent permitted by applicable law.
        When using or citing the work, you should not imply endorsement by the
        author or the affirmer.
        
        
        
        [1]: https://creativecommons.org/publicdomain/zero/1.0/legalcode
        
Requires-Python: <3.11,>=3.8
Description-Content-Type: text/markdown
Provides-Extra: dev
Provides-Extra: test
Provides-Extra: build
License-File: LICENSE.md

# 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 .
```
