The following PR includes preliminary capabilities to analyze stormwater and wastewater systems in WNTR. This capability resides in the stormwater subpackage and is referred to as S-WNTR since it is intended to be used as a standalone package. A subset of WNTR classes/methods/functions are imported into the stormwater subpackage to avoid duplicating code where possible.
The capabilities leverage SWMM, pyswmm, and swmmio within a framework that facilitates the use of WNTR for resilience analysis of stormwater and wastewater systems. This update includes SWMM, pyswmm, and swmmio as optional dependencies of WNTR.
Note that unlike WNTR for drinking water systems, S-WNTR does not convert models to SI units. The SWMM INP file units are retained.
Basic usage
The user can import wntr.stormwater as swntr and then load a SWMM INP file into a StormWaterNetworkModel object using swn = swntr.network.StormWaterNetworkModel(inp_filename). The model is stored as a collection of Pandas DataFrames, which can be modified to change model properties and create scenarios for resilience analysis.
Simulations are run using sim = swntr.sim.SWMMSimulator(swn) followed by results = sim.run_sim(). Simulation results are stored in pandas DataFrames for node, link, and subcatchment attributes.
Additional capabilities
Read/write SWMM INP files
Read SWMM RPT and OUT files
Convert the model to a NetworkX graph
Convert the model to GeoPandas GeoDataFrames
Save the model in GeoJSON file format
Add pump outage controls to the model
Add composite patterns to the model, to include multiple DWF per junction
Add/modify timeseries and patterns in the model using datetime indexed DataFrames
Identify upstream and downstream nodes and edges
Compute travel time using a steady state flowrate
Compute the time to reach capacity using a steady state flowrate
Compute pump power and energy use
Plot basic network graphics with node and link attributes
For more information, see stormwater.rst
Tests and documentation
Tests have been included in test_stormwater.py and documentation in stormwater.rst
coverage: 87.223% (-0.7%) from 87.907%
when pulling 84d58885f139653caa0983d9ed49d3abc5dfeb0e on kaklise:swntr
into eeb16c3fb5e6a8deaf535653a7489cdd5fdeeb28 on USEPA:main.
Summary
The following PR includes preliminary capabilities to analyze stormwater and wastewater systems in WNTR. This capability resides in the stormwater subpackage and is referred to as S-WNTR since it is intended to be used as a standalone package. A subset of WNTR classes/methods/functions are imported into the stormwater subpackage to avoid duplicating code where possible.
The capabilities leverage SWMM, pyswmm, and swmmio within a framework that facilitates the use of WNTR for resilience analysis of stormwater and wastewater systems. This update includes SWMM, pyswmm, and swmmio as optional dependencies of WNTR.
Note that unlike WNTR for drinking water systems, S-WNTR does not convert models to SI units. The SWMM INP file units are retained.
Basic usage The user can
import wntr.stormwater as swntr
and then load a SWMM INP file into aStormWaterNetworkModel
object usingswn = swntr.network.StormWaterNetworkModel(inp_filename)
. The model is stored as a collection of Pandas DataFrames, which can be modified to change model properties and create scenarios for resilience analysis.Simulations are run using
sim = swntr.sim.SWMMSimulator(swn)
followed byresults = sim.run_sim()
. Simulation results are stored in pandas DataFrames for node, link, and subcatchment attributes.Additional capabilities
For more information, see stormwater.rst
Tests and documentation
Tests have been included in test_stormwater.py and documentation in stormwater.rst
Acknowledgement
By contributing to this software project, I acknowledge that I have reviewed the software quality assurance guidelines and that my contributions are submitted under the Revised BSD License.