Python Water Resource model
Project description
This is a modified version of pywr to handle large dates (for stochastic years) using Pandas Period. The source code is available at: https://gitlab.com/s-simoncelli/pywr-stoch
To avoid major code refactoring, this version does not support:
non-fixed length time-step such as weekly or monthly. Only time-steps below the daily time-scale are supported
any DataFrame must already have the same frequency used in the model timestepper. Pandas does not support resampling with large dates yet
Pywr is a generalised network resource allocation model written in Python. It aims to be fast, free, and extendable.
Overview
Pywr is a tool for solving network resource allocation problems at discrete timesteps using a linear programming approach. It’s principal application is in resource allocation in water supply networks, although other uses are conceivable. A network is represented as a directional graph using NetworkX. Nodes in the network can be given constraints (e.g. minimum/maximum flows) and costs, and can be connected as required. Parameters in the model can vary time according to boundary conditions (e.g. an inflow timeseries) or based on states in the model (e.g. the current volume of a reservoir).
Models can be developed using the Python API, either in a script or interactively using IPython/Jupyter. Alternatively, models can be defined in a rich JSON-based document format.
New users are encouraged to read the Pywr Tutorial.
Design goals
Pywr is a tool for solving network resource allocation problems. It has many similarities with other software packages such as WEAP, Wathnet, Aquator and MISER, but also has some significant differences. Pywr’s principle design goals are that it is:
Fast enough to handle large stochastic datasets and large numbers of scenarios and function evaluations required by advanced decision making methodologies;
Free to use without restriction – licensed under the GNU General Public Licence;
Extendable – uses the Python programming language to define complex operational rules and control model runs.
Installation
Pywr should work on Python 3.7 (or later) on Windows, Linux or OS X.
See the documentation for detailed installation instructions.
For a quick start use pip:
pip install pywr
For most users it will be easier to install the binary packages made available from PyPi or the Anaconda Python distribution. Note that these packages may lag behind the development version.
Citation
Please consider citing the following paper when using Pywr:
Tomlinson, J.E., Arnott, J.H. and Harou, J.J., 2020. A water resource simulator in Python. Environmental Modelling & Software. https://doi.org/10.1016/j.envsoft.2020.104635
License
Copyright (C) 2014-20 Joshua Arnott, James E. Tomlinson, Atkins, University of Manchester
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file pywr_stoch-1.21.0.post1-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: pywr_stoch-1.21.0.post1-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dae29162922aee0bec52b3f051c1f0145b664bce7a15e14a9dde40e0840e9500 |
|
MD5 | 50a9b1ed5aa57c956cf5088436424f1a |
|
BLAKE2b-256 | f78eccbd7e4f4175f7e966bb0c3b07888f74bc71f689fca5266688c3f641d268 |