hyswap
A Python package which provides a set of functions for manipulating and visualizing USGS water data.
https://github.com/doi-usgs/hyswap
Category: Hydrosphere
Sub Category: Freshwater and Hydrology
Keywords from Contributors
usgs
Last synced: about 2 hours ago
JSON representation
Repository metadata
hyswap: HYdrologic Surface Water Analysis Package
- Host: GitHub
- URL: https://github.com/doi-usgs/hyswap
- Owner: DOI-USGS
- License: other
- Created: 2023-06-01T17:25:18.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2026-02-27T22:17:04.000Z (27 days ago)
- Last Synced: 2026-03-22T11:50:09.626Z (5 days ago)
- Language: Jupyter Notebook
- Homepage: https://doi-usgs.github.io/hyswap/
- Size: 123 MB
- Stars: 30
- Watchers: 3
- Forks: 5
- Open Issues: 2
- Releases: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
README.md
hyswap - HYdrologic Surface Water Analysis Package
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.
Owner metadata
- Name: U.S. Geological Survey
- Login: DOI-USGS
- Email: gs_help_git@usgs.gov
- Kind: organization
- Description: By integrating our diverse scientific expertise, we understand complex natural science phenomena and provide scientific products that lead to solutions.
- Website: https://www.usgs.gov/
- Location: United States of America
- Twitter: USGS
- Company:
- Icon url: https://avatars.githubusercontent.com/u/65027635?v=4
- Repositories: 59
- Last ynced at: 2023-06-11T08:40:17.441Z
- Profile URL: https://github.com/DOI-USGS
GitHub Events
Total
- Release event: 1
- Pull request event: 1
- Fork event: 1
- Issues event: 1
- Watch event: 15
- Issue comment event: 3
- Push event: 6
Last Year
- Issues event: 1
- Watch event: 7
- Push event: 2
Committers metadata
Last synced: 3 days ago
Total Commits: 585
Total Committers: 7
Avg Commits per committer: 83.571
Development Distribution Score (DDS): 0.615
Commits in past year: 34
Committers in past year: 1
Avg Commits per committer in past year: 34.0
Development Distribution Score (DDS) in past year: 0.0
| Name | Commits | |
|---|---|---|
| Elise Hinman | e****n@u****v | 225 |
| elbeejay | j****n@u****v | 192 |
| Hamshaw, Scott Douglas | s****w@u****v | 115 |
| Margaux Sleckman | m****n@u****v | 42 |
| Joe Zemmels (he/him) | j****s@g****m | 7 |
| Stanish, Lee | l****h@u****v | 3 |
| Ross, Jesse C | j****s@u****v | 1 |
Committer domains:
- usgs.gov: 6
Issue and Pull Request metadata
Last synced: 20 days ago
Total issues: 0
Total pull requests: 1
Average time to close issues: N/A
Average time to close pull requests: about 2 months
Total issue authors: 0
Total pull request authors: 1
Average comments per issue: 0
Average comments per pull request: 3.0
Merged pull request: 1
Bot issues: 0
Bot pull requests: 0
Past year issues: 0
Past year pull requests: 0
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 0
Past year average comments per issue: 0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
Top Pull Request Authors
- jzemmels (1)
Top Issue Labels
Top Pull Request Labels
Package metadata
- Total packages: 1
-
Total downloads:
- pypi: 280 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 8
- Total maintainers: 2
pypi.org: hyswap
Analysis of surface water data.
- Homepage:
- Documentation: https://hyswap.readthedocs.io/
- Licenses: 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://www.usgs.gov/information-policies-and-instructions/copyrights-and-credits. 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)](https://creativecommons.org/publicdomain/zero/1.0/legalcode). ### 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.
- Latest release: 1.0.0 (published over 1 year ago)
- Last Synced: 2026-03-24T02:01:30.443Z (3 days ago)
- Versions: 8
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 280 Last month
-
Rankings:
- Dependent packages count: 7.387%
- Average: 26.076%
- Dependent repos count: 44.766%
- Maintainers (2)
Dependencies
- actions/checkout v2 composite
- actions/setup-python v2 composite
- JamesIves/github-pages-deploy-action v4.4.2 composite
- actions/checkout v3 composite
- actions/checkout v3 composite
- actions/setup-python v3 composite
- pypa/gh-action-pypi-publish release/v1 composite
- coverage * development
- dataretrieval * development
- flake8 * development
- pydeps ==1.12.3 development
- pydocstringformatter * development
- pylint * development
- pytest * development
- sphinx * development
- matplotlib *
- numpy *
- pandas *
- scipy *
Score: 11.053553122793154