Skip to main content

Python Water Resource model

Project description

Pywr is a generalised network resource allocation model written in Python. It aims to be fast, free, and extendable.

https://github.com/pywr/pywr/workflows/Build/badge.svg?branch=master https://img.shields.io/badge/chat-on%20gitter-blue.svg https://codecov.io/gh/pywr/pywr/branch/master/graph/badge.svg

Overview

Documentation

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.

https://raw.githubusercontent.com/pywr/pywr/master/docs/source/_static/pywr_d3.png

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.

Provided that you have the required dependencies already installed, it’s as simple as:

python setup.py install --with-glpk --with-lpsolve

For most users it will be easier to install the binary packages made available for the Anaconda Python distribution. See install docs for more information. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pywr-1.16.0.tar.gz (3.1 MB view details)

Uploaded Source

Built Distributions

pywr-1.16.0-cp39-cp39-manylinux2014_x86_64.whl (17.4 MB view details)

Uploaded CPython 3.9

pywr-1.16.0-cp38-cp38-win_amd64.whl (4.9 MB view details)

Uploaded CPython 3.8 Windows x86-64

pywr-1.16.0-cp38-cp38-manylinux2014_x86_64.whl (18.8 MB view details)

Uploaded CPython 3.8

pywr-1.16.0-cp37-cp37m-win_amd64.whl (4.8 MB view details)

Uploaded CPython 3.7m Windows x86-64

pywr-1.16.0-cp37-cp37m-manylinux2014_x86_64.whl (15.7 MB view details)

Uploaded CPython 3.7m

File details

Details for the file pywr-1.16.0.tar.gz.

File metadata

  • Download URL: pywr-1.16.0.tar.gz
  • Upload date:
  • Size: 3.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for pywr-1.16.0.tar.gz
Algorithm Hash digest
SHA256 2a233818f642115e0ded77bbe866147bd55d72f487a1ecc04a520c927aaddc76
MD5 6c9056caa71d301ef0e421b8ab9d469b
BLAKE2b-256 7b1d85f39893df043861185f665c010c477b3a3a56f1f0e7f93ab23a535942b0

See more details on using hashes here.

File details

Details for the file pywr-1.16.0-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

  • Download URL: pywr-1.16.0-cp39-cp39-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 17.4 MB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for pywr-1.16.0-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9f3eae4132b04453ad90f3cc9df700ce6e77015f36c92271c19e6455f3536216
MD5 30395f4c07940a820e7a162c0d5b5358
BLAKE2b-256 169b055eed88858cb10205383432243f218c609496cf522cba655e0d5022e61f

See more details on using hashes here.

File details

Details for the file pywr-1.16.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: pywr-1.16.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 4.9 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for pywr-1.16.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 203ed65dc6d6cb1e00c0c4fd94e0f97ab534c96afd726a6bae76ec1b7ac114fb
MD5 e4186cc797a55e9aa340b7534f40db85
BLAKE2b-256 80973fa2f6ecf48d27dc5e79eb8ff413c249dfa70376c7f63b60a235a8eef54a

See more details on using hashes here.

File details

Details for the file pywr-1.16.0-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

  • Download URL: pywr-1.16.0-cp38-cp38-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 18.8 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for pywr-1.16.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d1c9c03c2d0a3f9d233c68c55dca70440ebed9550172829674385333de3f07d8
MD5 7c025eeca559e945389d76d5787dce43
BLAKE2b-256 d6b3a67882665f02522f38b89deae485ded4ed6f8b16699904c92be235438f7c

See more details on using hashes here.

File details

Details for the file pywr-1.16.0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: pywr-1.16.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 4.8 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for pywr-1.16.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 5ef97532444729c64a692a9fe02e9d78c471d8936c7257c9606a243f0158d318
MD5 4ebbf2e47b2a1c54e14027d8a5918605
BLAKE2b-256 c65602aeaed5a09cb2af13cb31aa1ab15a07796125562b793fdb5547ed7b0fd1

See more details on using hashes here.

File details

Details for the file pywr-1.16.0-cp37-cp37m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: pywr-1.16.0-cp37-cp37m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 15.7 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for pywr-1.16.0-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ea65d9c2979583fd1fe720936cd6c7562849badcbe222a4e6ca07483b3ef4c0d
MD5 ce1ab8f0220cf7ec5ace59330794c3b0
BLAKE2b-256 4ecb380747b47003f1e368475e5032aa898cadd51c4ce9c1136c73fb60e049bd

See more details on using hashes here.

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