Skip to main content

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

Project description

VisWaterNet

https://img.shields.io/pypi/v/viswaternet.svg Documentation Status

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

Dependencies

  • Python 3.7+

  • Numpy

  • Pandas

  • Matplotlib

  • 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.

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")

Credits

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

History

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-0.1.3.tar.gz (27.9 kB 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