VisWaterNet

VisWaterNet: A Python package for visualization of water distribution networks - Published in JOSS (2023)

https://github.com/tylertrimble/viswaternet

Science Score: 100.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 6 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org
  • Committers with academic emails
    2 of 4 committers (50.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Scientific Fields

Sociology Social Sciences - 64% confidence
Last synced: 4 months ago · JSON representation ·

Repository

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

Basic Info
Statistics
  • Stars: 19
  • Watchers: 4
  • Forks: 4
  • Open Issues: 18
  • Releases: 12
Created over 3 years ago · Last pushed 4 months ago
Metadata Files
Readme Changelog Contributing License Citation Authors

README.rst

.. image:: https://github.com/tylertrimble/viswaternet/blob/main/logo/viswaternet_logo.png?raw=true
		:target: https://github.com/tylertrimble/viswaternet/blob/main/logo/viswaternet_logo.png?raw=true

.. image:: https://joss.theoj.org/papers/10.21105/joss.05139/status.svg
        :target: https://doi.org/10.21105/joss.05139

.. image:: https://img.shields.io/pypi/v/viswaternet.svg
        :target: https://pypi.python.org/pypi/viswaternet

.. image:: https://readthedocs.org/projects/viswaternet/badge/?version=latest
        :target: https://viswaternet.readthedocs.io/en/latest/
        :alt: Documentation Status

.. image:: https://img.shields.io/pypi/l/ansicolortags.svg
        :target: https://pypi.python.org/pypi/ansicolortags/
    

An open-source Python package for easy generation and customization of water distribution network visualizations. Find the `documentation here`_.

.. _`documentation here`: https://viswaternet.readthedocs.io


Dependencies
------------
◉ WNTR ◉ NetworkX 2.7+ ◉ Matplotlib 3.5.0+ ◉ Pandas ◉ NumPy ◉ imageio ◉

VisWaterNet has been tested on Python **3.8+**.

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:

.. code:: python

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

.. code:: python

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

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

.. code:: python

    python setup.py install

Getting Started
---------------
To get started, import the VisWaterNet package:

.. code:: python

    import viswaternet as vis
    
Next, initialize a VisWaterNet model and optionally a style object. For example purposes, we use the CTown network from `Ostfeld (2016)`_ included in the Examples folder:

.. code:: python

    model = vis.VisWNModel('Networks/CTown.inp')
    style = vis.NetworkStyle(discrete_legend_loc='lower left', legend_sig_figs=0)
.. _`Ostfeld (2016)`: https://uknowledge.uky.edu/wdst_models/2/
    
Then, call on any of the plotting functions with the argument inputs of your choice. For example, the following line of code displays the network layout of CTown with each node colored according its mean pressure (in *psi*). This is a **continuous** node plot, where the nodal colors are assigned based a gradient scale:

.. code:: python

    model.plot_continuous_nodes(parameter="pressure", value='mean', unit="psi")
    
.. figure:: logo/readme1.png
   :width: 600
   :alt: Basic network layout

We can represent the same data in a different way by generating a **discrete** node plot in which mean pressure data is grouped into 4 discrete intervals and node colors are assigned based on the corresponding value shown on a legend:

.. code:: python

    model.plot_discrete_nodes(parameter="pressure", value='mean', unit="psi",
                              intervals = [0,40,80,120],
                              style=style)

.. figure:: logo/readme2.png
   :width: 600
   :alt: Basic network layout

If the plot does not show up after you run the script, it is possible that your IDE does not support interactive plotting (e.g., IDLE) or interactive mode is off. To see the plot, add the following line to display the figures: 

.. code:: python

    plt.show()

Since several VisWaterNet function arguments rely on Matplotlib visualization inputs, it is recommended to visit the `Matplotlib docs`_ to view customization options for `colors`_, `colorbars`_, `node markers`_, `line styles`_, etc.

.. _`Matplotlib docs`: https://matplotlib.org/stable/index.html
.. _`colors`: https://matplotlib.org/stable/gallery/color/named_colors.html
.. _`colorbars`: https://matplotlib.org/stable/tutorials/colors/colormaps.html#sphx-glr-tutorials-colors-colormaps-py
.. _`node markers`: https://matplotlib.org/stable/gallery/lines_bars_and_markers/marker_reference.html
.. _`line styles`: https://matplotlib.org/stable/gallery/lines_bars_and_markers/linestyles.html

More examples that demonstrate the range of VisWaterNet's plotting abilities can be found in the `Example Applications`_ section of the docs.

.. _`Example Applications`: https://viswaternet.readthedocs.io/en/latest/examples.html

Contributing
------------
We welcome contributions in the form of suggestions, feedback, reports of bugs, and additions to code functionality and documentation from all users! You can find instructions to raise issues, submit pull requests, and `run automated tests`_ in the `docs`_ or the `CONTRIBUTING page`_.

.. _`CONTRIBUTING page`: https://github.com/tylertrimble/viswaternet/blob/main/CONTRIBUTING.rst
.. _`docs`: https://viswaternet.readthedocs.io/en/latest/contributing.html
.. _`run automated tests`: https://viswaternet.readthedocs.io/en/latest/contributing.html#testing

Cite Us
-------

To cite VisWaterNet, please use the following publication: `VisWaterNet: A Python package for visualization of water distribution networks`_

.. _`VisWaterNet: A Python package for visualization of water distribution networks`: https://joss.theoj.org/papers/10.21105/joss.05139

::

    @article{doi:10.21105/joss.05139,
     title={VisWaterNet: A Python package for visualization of water distribution networks},
     author={Thomas, Meghna and Trimble, Tyler and Sela, Lina},
     journal={Journal of Open Source Software},
     volume={8},
     number={84},
     pages={5139},
     year={2023}}

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.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage

JOSS Publication

VisWaterNet: A Python package for visualization of water distribution networks
Published
April 11, 2023
Volume 8, Issue 84, Page 5139
Authors
Meghna Thomas
Department of Civil, Architectural and Environmental Engineering, The University of Texas at Austin
Tyler Trimble
Department of Civil, Architectural and Environmental Engineering, The University of Texas at Austin
Lina Sela ORCID
Department of Civil, Architectural and Environmental Engineering, The University of Texas at Austin
Editor
Chris Vernon ORCID
Tags
NetworkX Water distribution Visualization

Citation (CITATION.cff)

cff-version: "1.2.0"
authors:
- family-names: Thomas
  given-names: Meghna
- family-names: Trimble
  given-names: Tyler
- family-names: Sela
  given-names: Lina
  orcid: "https://orcid.org/0000-0002-5834-8451"
contact:
- family-names: Thomas
  given-names: Meghna
doi: 10.5281/zenodo.7799929
message: If you use this software, please cite our article in the
  Journal of Open Source Software.
preferred-citation:
  authors:
  - family-names: Thomas
    given-names: Meghna
  - family-names: Trimble
    given-names: Tyler
  - family-names: Sela
    given-names: Lina
    orcid: "https://orcid.org/0000-0002-5834-8451"
  date-published: 2023-04-11
  doi: 10.21105/joss.05139
  issn: 2475-9066
  issue: 84
  journal: Journal of Open Source Software
  publisher:
    name: Open Journals
  start: 5139
  title: "VisWaterNet: A Python package for visualization of water
    distribution networks"
  type: article
  url: "https://joss.theoj.org/papers/10.21105/joss.05139"
  volume: 8
title: "VisWaterNet: A Python package for visualization of water
  distribution networks"

GitHub Events

Total
  • Create event: 1
  • Issues event: 3
  • Release event: 1
  • Watch event: 5
  • Push event: 6
  • Fork event: 1
Last Year
  • Create event: 1
  • Issues event: 3
  • Release event: 1
  • Watch event: 5
  • Push event: 6
  • Fork event: 1

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 577
  • Total Committers: 4
  • Avg Commits per committer: 144.25
  • Development Distribution Score (DDS): 0.432
Past Year
  • Commits: 28
  • Committers: 2
  • Avg Commits per committer: 14.0
  • Development Distribution Score (DDS): 0.214
Top Committers
Name Email Commits
Tyler Trimble T****e@g****m 328
Meghna Thomas 7****s 236
jlynnangel j****a@u****u 12
gr24269 g****o@u****u 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 136
  • Total pull requests: 8
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 3 days
  • Total issue authors: 7
  • Total pull request authors: 2
  • Average comments per issue: 0.76
  • Average comments per pull request: 0.0
  • Merged pull requests: 7
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 7
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 2
  • Pull request authors: 0
  • Average comments per issue: 0.14
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • meghnathomas (100)
  • tylertrimble (28)
  • mfrankel923 (2)
  • thurber (1)
  • mariocastrogama (1)
  • gregrhend (1)
  • erexer (1)
Pull Request Authors
  • tylertrimble (11)
  • meghnathomas (2)
Top Labels
Issue Labels
JOSS (14) enhancement (12) Low Priority (4) High Priority (3) wontfix (3) Examples/Docs (2) Testing (1) question (1) duplicate (1) Medium Priority (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 13 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 13
  • Total maintainers: 1
pypi.org: viswaternet

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

  • Versions: 13
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 13 Last month
Rankings
Dependent packages count: 6.6%
Downloads: 18.8%
Average: 20.5%
Forks count: 23.2%
Stargazers count: 23.3%
Dependent repos count: 30.6%
Maintainers (1)
Last synced: 4 months ago

Dependencies

.github/workflows/draft-pdf.yml actions
  • actions/checkout v2 composite
  • actions/upload-artifact v1 composite
  • openjournals/openjournals-draft-action master composite
.github/workflows/python-app.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
requirements.txt pypi
  • imageio *
  • matplotlib >=3.5.0
  • networkx *
  • numpy *
  • pandas *
  • wntr *
requirements_dev.txt pypi
  • Click ==7.1.2 development
  • Sphinx ==1.8.5 development
  • bump2version ==0.5.11 development
  • coverage ==4.5.4 development
  • flake8 ==3.7.8 development
  • pip ==19.2.3 development
  • tox ==3.14.0 development
  • twine ==1.14.0 development
  • watchdog ==0.9.0 development
  • wheel ==0.33.6 development