Getting Started

To get started, import VisWaterNet:

import viswaternet as vis

Next, initialize a VisWaterNet model by providing a .INP input file of a water network model. For example purposes, we use the CTown network included in the Examples folder:

model = vis.VisWNModel('Networks/CTown.inp')

Finally, call on any of the plotting functions with the argument inputs of your choice. For example, the following line of code generates a discrete plot for maximum nodal pressure in units of psi:

model.plot_discrete_nodes(ax, parameter="pressure", value='max', unit="psi")

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:

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.

A range of examples to understand the different VisWaterNet plotting functions can be found in the Example Applications section in the documentation and in the the Examples folder.