Skip to main content

A python package for easy generation and customization of water network graphs.

Project description

https://github.com/tylertrimble/viswaternet/blob/master/logo/viswaternet_logo.png?raw=true https://img.shields.io/pypi/v/viswaternet.svg Documentation Status

A Python package for easy generation and customization of water distribution network visualizations.

Dependencies

  • Python 3.7+

  • Numpy

  • Pandas

  • Matplotlib 3.3.0+

  • NetworkX

  • imageio

Features

Viswaternet is designed to plot simulation data onto a network graph, with a large variety of customization options available. The package includes the capabilities to:

  • Discretize network or simulation data.

  • Visualize discretized or continuous data on network graphs.

  • Import data from excel files or data generated with python.

  • Create GIFs of data across simulation timesteps.

  • Customize style of virtually every element of the network graph, including: reservoirs, tanks, valves, pumps, links, and nodes.

  • Draw labels relative to nodes or based on an absolute position on the figure.

  • Draw specific nodes or links with their own data and style.

Installation

To install VisWaterNet, run this command in your terminal:

pip install viswaternet

Alternatively, the sources for VisWaterNet can be downloaded from the Github repo. You can clone the public repository:

git clone git://github.com/tylertrimble/viswaternet

Once you have a copy of the source, you can install it with:

python setup.py install

Getting Started

To get started, import both viswaternet and matplotlib.pyplot:

import viswaternet as vis
import matplotlib.pyplot as plt

Next, initialize a matplotlib figure and viswaternet model. For example purposes we use the CTown network included in the Examples folder:

fig, ax = plt.subplots(figsize=(12, 12))
model = vis.VisWNModel(r'Networks/CTown.inp')

Finally, call on any of the plotting functions with the argument inputs of your choice. For example:

model.plot_discrete_nodes(ax,parameter="quality",value='max',unit="hr")

Contact

Tyler Trimble - tylerl.trimble@utexas.edu

Meghna Thomas - meghnathomas@utexas.edu

Lina Sela - linasela@utexas.edu

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

1.0.0 (2023-02-07)

  • Greatly improved animate_plot() function speed

  • Fixed numerous bugs related to excel data plotting

  • Added ability to use directional arrows with continuous plots

0.1.5 (2023-01-22)

  • Complete documentation

  • Fixed animate plot bugs

  • Changed how num_interval parameter works

  • Fixed warnings

0.1.4 (2022-12-19)

  • Updated requirements

0.1.3 (2022-12-17)

  • Bug fixes

  • Some documentation added

0.1.2 (2022-11-11)

  • Rename package once more to avoid confusion with R package ‘visnetwork’.

0.1.1 (2022-11-11)

  • Fix import errors due to package name change.

0.1.0 (2022-11-11)

  • First release on PyPI.

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

viswaternet-1.0.0.tar.gz (3.9 MB view hashes)

Uploaded Source

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