USEPA / WNTR

An EPANET compatible python package to simulate and analyze water distribution networks under disaster scenarios.
Other
312 stars 183 forks source link

Addition of stormwater and wastewater capabilities in WNTR #437

Open kaklise opened 2 months ago

kaklise commented 2 months ago

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

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.

coveralls commented 2 months ago

Coverage Status

coverage: 87.223% (-0.7%) from 87.907% when pulling 84d58885f139653caa0983d9ed49d3abc5dfeb0e on kaklise:swntr into eeb16c3fb5e6a8deaf535653a7489cdd5fdeeb28 on USEPA:main.