PyVISCOUS: Open-Source VISCOUS Code in Python
VISCOUS is a variance-based global sensitivity analysis framework (Sheikholeslami et al. 2021, Liu et al. 2024). Functioning as a "given-data" method, VISCOUS utilizes existing model input and output data, such as water model parameters and responses, to provide valuable approximations of first- and total-order Sobol’ sensitivity indices. The input-output data can be from previous model runs conducted for various modeling purposes (e.g., model calibration and uncertainty analysis).
Install pyviscous
Approach 1: From PyPI
pip install pyviscous
Approach 2: From source
# Clone the repository (replace <your_username> with your GitHub username)
git clone https://github.com/<your_username>/pyviscous.git
# Navigate into the cloned directory
cd pyviscous
# Install pyviscous using pyproject.toml-based build system
pip install .
Note: This assumes you have forked the repository from GitHub manually.
Approach 3: Use pyviscous without installing
If you prefer not to install pyviscous, or you'd like to develop or quickly test pyviscous, you can directly run it by adding the source directory to your system path:
import sys
sys.path.insert(0, "<path_to_directory>")
import pyviscous
Replace <path_to_directory> with the absolute path to your local pyviscous folder.
Before using pyviscous this way, ensure its dependencies are installed manually:
pip install "wheel>=0.36"
pip install copulae
Installation notes for Approach 3
(1) Why wheel>=0.36 is needed?
- When the
wheelpackage is not installed,pipfalls back to the legacysetup.py installmethod to installcopulaewhere dependencies likenumpyare required at the build time. - Since
copulaeuses apyproject.toml-based build system,pipbuilds it in an isolated environment to prevent interference from your existing environment. This means it cannot access pre-installed packages likenumpy, leading to the error ModuleNotFoundError: No module named 'numpy'. - Installing
wheel>=0.36enables pip to use the modern PEP 517/518 build process, which correctly handles build-time dependencies likenumpyinside the isolated environment.
(2) Install copulae using pip, not conda.
The conda version of copulae lacks some source code and functionality, which can lead to runtime errors or missing features.
(3) Automatic dependencies installed by copulae.
When you install copulae (e.g., version 0.7.9), the following packages are installed automatically via pip:
- numpy>=1.20
- pandas>=1.1
- scikit-learn>=1.2
- scipy>=1.5
- statsmodels>=0.12
- typing-extensions>=4.0.0
- wrapt>=1.12
You do not need to install these manually unless you want to control or pin their versions.
Examples
We provide five demonstration notebooks in the example directory, including the Rosenbrock function and four Sobol’ functions from Liu et al. (2024). Additionally, a real case study of the Bow at Banff basin, Alberta, Canada, is included to show the real-world application of VISCOUS. Each example includes scripts for input-output data generation or reading, VISCOUS setup and execution, and evaluation of sensitivity results.
Credits
VISCOUS was originally developed by Sheikholeslami et al. (2021) and enhanced by Liu et al. (2023).
- Sheikholeslami, R., Gharari, S., Papalexiou, S. M., & Clark, M. P. (2021) VISCOUS: A variance-based sensitivity analysis using copulas for efficient identification of dominant hydrological processes. Water Resources Research, 57, e2020WR028435. https://doi.org/10.1029/2020WR028435
- Liu, H., Clark, M. P., Gharari, S., Sheikholeslami, R., Freer, J., Knoben, W. J. M., Marsh C. B., & Papalexiou, S. M. (2024) An improved copula-based framework for efficient global sensitivity analysis. Water Resources Research, 60, e2022WR033808. https://doi.org/10.1029/2022WR033808
This package was created with Cookiecutter and the https://github.com/audreyr/cookiecutter-pypackage project template.
Metadata
Release files for pyviscous 2.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyviscous-2.2.2.tar.gz | 20.1 kB | Without provenance | Details for pyviscous-2.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyviscous-2.2.2-py3-none-any.whl | Python 3 | none | any | Details for pyviscous-2.2.2-py3-none-any.whl |
Total release size: 38.8 kB
Release files / pyviscous-2.2.2.tar.gz
| Download URL | pyviscous-2.2.2.tar.gz |
|---|---|
| Size | 20.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a95b156f81534f13fde6b91112fe8549077fc095a7b344dde18fd6c1699492c6
|
|
BLAKE2b-256 checksum How to use checksums |
f1b02b34d179a149a90f7d6a6e4b1bebd873fa6c3c73746e10d22bd5aa3db1ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.5
|
Release files / pyviscous-2.2.2-py3-none-any.whl
| Download URL | pyviscous-2.2.2-py3-none-any.whl |
|---|---|
| Size | 18.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d8e01ba8eb1c8084e67969d1f7e89656af2122cdc82af4d84540246d4ad4ae63
|
|
BLAKE2b-256 checksum How to use checksums |
227664b2e00159795afacfe7e63a509996a601aba3791929cb5bdb601a97997e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.5
|
Security for pyviscous 2.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.