WaCo is a library for simulating contaminations in water networks built on-top of the WNTR library.
For further details, consult the documentation.
Installation
The only requirement is the WNTR library that is used for the hydraulic simulations:
-
Python >= 3.9
-
wntr >= 1.1.0
The latest release of WaCo can be easily installed via pip.
pip install waco
You can also install the latest developement version directly from GitHub.
pip install --upgrade git+https://github.com/andreaponti5/waco
Getting Started
WaCo is composed by two modules:
-
sim: contains the functionalities to perform hydraulic simulations for extracting the demands and the contaminant diffusion in water networks. It mainly acts as a wrapper around the WNTR library. -
analyzer: contains the functionalities to extract the detection times and the volumes of contaminated water from the simulations.
Note: Refer to the API Reference for more details about the two modules.
To extract the detection times you need to simulate the diffusion of contaminant with the sim and then use the analyzer module.
import waco
import wntr
wn = wntr.network.WaterNetworkModel("examples/networks/Anytown.inp")
trace = waco.sim.contamination(wn=wn)
det_time = waco.analyzer.detection_time(trace)
The detection times are returned in a Dataframe containing the time when the contaminant exceeds a given threshold in a node considering a specific injection point.
| node | inj_node | time |
|----------|:------------:|:--------:|
| 1 | 1 | 0 |
| 1 | 2 | 18900 |
| ... | ... | ... |
| 9 | 21 | 18900 |
| 9 | 22 | 5400 |
To extract the volume of contaminated water prior detection you also need to compute the demand at each node using the sim module.
demand = waco.sim.water_demand(wn)
contam_vol = waco.analyzer.contaminated_volume(trace=trace,
det_time=det_time,
demand=demand)
The volumes are returned in a Dataframe containing the volume of contaminated water prior detection in each node considering a specific injection point.
| node | inj_node | volume |
|----------|:------------:|:----------:|
| 1 | 1 | 0.031545 |
| 1 | 2 | 0.116008 |
| ... | ... | ... |
| 9 | 21 | 0.118453 |
| 9 | 22 | 0.102254 |
Metadata
Release files for waco 0.1.0
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 |
|---|---|---|---|---|
| waco-0.1.0.tar.gz | 6.5 kB | Without provenance | Details for waco-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| waco-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for waco-0.1.0-py3-none-any.whl |
Total release size: 13.2 kB
Release files / waco-0.1.0.tar.gz
| Download URL | waco-0.1.0.tar.gz |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2990b0bf8ab351c6b665a5f34cf5d65a3a5bc3f0309e69f2885a126b1df26c57
|
|
BLAKE2b-256 checksum How to use checksums |
1b8726b41a233771f3dba95dc7716e74c29f4449a345690ef2b1bafcd22da57d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.3
|
Release files / waco-0.1.0-py3-none-any.whl
| Download URL | waco-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a3b22cd129a2b170a47045c3d686063c08edb2aab027ab829f3b816aa0d73d9a
|
|
BLAKE2b-256 checksum How to use checksums |
7894768a3f4c833309427c3673d431d49dcf8d5298ab6a7ed361266f49847291
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.3
|
Security for waco 0.1.0
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.