Skip to main content

Analysis of surface water data.

Project description

hyswap - HYdrologic Surface Water Analysis Package

USGS-category-image pipeline-status-image coverage-report-image PyPI version PyPI - Python Version

Overview

hyswap (HYdrologic Surface Water Analysis Package), is a Python package which provides a set of functions for manipulating and visualizing USGS water data. Specifically, a number of functions for calculating statistics (e.g., exceedance probabilities, daily historic percentiles) and generating related plots (e.g., flow duration curves, streamflow duration hydrographs) are available. These methods are provided in a modular fashion as individual functions, and are designed to give the user flexibility in implementation.

Project Documentation

For more information, visit the hyswap documentation.

Installation

User Installation via pip

One-liner to install hyswap via pip:

pip install hyswap

Note: hyswap has 4 dependencies right now, numpy, pandas, scipy, and matplotlib, these will be installed automatically when installing the package via pip.

User Installation From Source

To install hyswap from source, first you will need to clone the repository. Next, from the root of the repository, run the following commands in your non-base environment:

pip install -r requirements.txt
pip install .

Developer Installation

Developer installation should be performed from source. First you will need to clone the repository. Next, from the root of the repository, you have two options:

Option 1: Initiate your own python environment and then pip install the required packages

In a non-base environment, use the pip command to install both the requirements.txt and the requirements-dev.txt. Then run pip install . to obtain the source version of hyswap.

pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install .

Option 2: Use the environment-dev.yml to initiate a conda/mamba environment and download required packages from conda-forge and pypi

If you are a conda or mamba user, the shell code below will create a development environment called hyswap-dev-environment, activate it, and then install hyswap into the environment from source. Replace conda with mamba where appropriate for mamba users.

conda env create -f environment-dev.yml
conda activate hyswap-dev-environment
pip install .

Testing and Building Documentation Locally

To test the code and building and test the documentation locally, you must have cloned the source repository, follow the instructions above for a "developer installation" first.

To test the package locally, run the following command from the root of the repository:

pytest

To build the documentation locally, run the following commands from the root of the repository:

cd docs
make docs

Running the Linting and Formatting Checks Locally

To run the linting and formatting checks locally, run the following commands from the root of the repository:

flake8 .
pydocstringformatter .

Running the Example Workflow Notebooks

The example Jupyter (.ipynb) notebooks contain extended use cases of hyswap functions. They are displayed in the documentation pages, or you may download the notebooks from the 'example_notebooks' folder in this repository. The notebooks sometimes utilize additional packages that are not required to run the hyswap functions in isolation. You can use the developer installation instructions to create an environment containing all of the required packages to run the notebooks. Don't forget to also pip install hyswap into your working environment!

Contributing

See the contributing guidelines for more information.

Citation

Hamshaw, S.D., Hariharan, J., Hinman, E.D., Sleckman, M.J., Stanish, L.F., 2024, hyswap: A USGS software package for hydrologic data analysis, DOI: https://doi.org/10.5066/P13SKXA2

Questions?

Please send an email to comptools@usgs.gov with 'hyswap' noted somewhere in the subject line.

License

See the license for more information.

Disclaimer

See the disclaimer for more information.

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

hyswap-1.0.0.tar.gz (2.0 MB view details)

Uploaded Source

Built Distribution

hyswap-1.0.0-py3-none-any.whl (43.6 kB view details)

Uploaded Python 3

File details

Details for the file hyswap-1.0.0.tar.gz.

File metadata

  • Download URL: hyswap-1.0.0.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for hyswap-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3e41e3fc993340d3ef3c76850eb0dfffe58646e47bb2de366bff3e885594f882
MD5 02f1ff72dcd3195a96a27912d151e840
BLAKE2b-256 2d1c9d080c91785cb97ba57d482b540d2e460864448362b87d066c4c93730324

See more details on using hashes here.

Provenance

The following attestation bundles were made for hyswap-1.0.0.tar.gz:

Publisher: pypi.yml on DOI-USGS/hyswap

Attestations:

File details

Details for the file hyswap-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: hyswap-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 43.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for hyswap-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b3df53eb36eb20db4101dabff2e8d9ac1cf0241985edca137c93c5f9b4be16c9
MD5 594dc6e9ccb47c612319c53834b4d121
BLAKE2b-256 61159e8acb884edfbef911ea7631f419f9efe9af6909b900365c2910ae122c13

See more details on using hashes here.

Provenance

The following attestation bundles were made for hyswap-1.0.0-py3-none-any.whl:

Publisher: pypi.yml on DOI-USGS/hyswap

Attestations:

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