diff --git a/.gitignore b/.gitignore index 08a3a0a..1738127 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ *.pyc private.py -*.ipynb* private/ # Setuptools distribution folder. /dist/ diff --git a/README.md b/README.md index 7a9bc2b..d557112 100644 --- a/README.md +++ b/README.md @@ -1,262 +1,27 @@ # swmmio *v0.7.3 (2024/12/02)* -![example workflow](https://github.com/aerispaha/swmmio/actions/workflows/python-app.yml/badge.svg) -[![Documentation Status](https://readthedocs.org/projects/swmmio/badge/?version=latest)](https://swmmio.readthedocs.io/en/latest/?badge=latest) - -![Kool Picture](docs/img/impact_of_option.png?raw=true "Impact of Option") -`swmmio` is a set of python tools aiming to provide a means for version control and visualizing results from the EPA Stormwater Management Model (SWMM). Command line tools are also provided for running models individually and in parallel via Python's `multiprocessing` module. These tools are being developed specifically for the application of flood risk management, though most functionality is applicable to SWMM modeling in general. - - -### Prerequisites -`swmmio` functions primarily by interfacing with .inp and .rpt (input and report) files produced by SWMM. Functions within the `run_models` module rely on a SWMM5 engine which can be downloaded [here](https://www.epa.gov/water-research/storm-water-management-model-swmm). - -### Installation: -Before installation, it's recommended to first activate a [virtualenv](https://github.com/pypa/virtualenv) to not crowd your system's package library. If you don't use any of the dependencies listed above, this step is less important. SWMMIO can be installed via pip in your command line: - -```bash -pip install swmmio -``` - -### Basic Usage -The `swmmio.Model()` class provides the basic endpoint for interfacing with SWMM models. To get started, save a SWMM5 model (.inp) in a directory with its report file (.rpt). A few examples: -```python -import swmmio - -#instantiate a swmmio model object -mymodel = swmmio.Model('/path/to/directory with swmm files') - -# Pandas dataframe with most useful data related to model nodes, conduits, and subcatchments -nodes = mymodel.nodes.dataframe -links = mymodel.links.dataframe -subs = mymodel.subcatchments.dataframe - -#enjoy all the Pandas functions -nodes.head() -``` -
InvertElev | MaxDepth | SurchargeDepth | PondedArea | Type | AvgDepth | MaxNodeDepth | MaxHGL | MaxDay_depth | MaxHr_depth | HoursFlooded | MaxQ | MaxDay_flood | MaxHr_flood | TotalFloodVol | MaximumPondDepth | X | Y | coords | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Name | |||||||||||||||||||
S42A_10.N_4 | 13.506673 | 6.326977 | 5.0 | 110.0 | JUNCTION | 0.69 | 6.33 | 19.83 | 0 | 12:01 | 0.01 | 0.20 | 0.0 | 11:52 | 0.000 | 6.33 | 2689107.0 | 227816.000 | [(2689107.0, 227816.0)] |
D70_ShunkStreet_Trunk_43 | 8.508413 | 2.493647 | 5.0 | 744.0 | JUNCTION | 0.04 | 0.23 | 8.74 | 0 | 12:14 | NaN | NaN | NaN | NaN | NaN | NaN | 2691329.5 | 223675.813 | [(2691329.5, 223675.813)] |
TD61_1_2_90 | 5.150000 | 15.398008 | 0.0 | 0.0 | JUNCTION | 0.68 | 15.40 | 20.55 | 0 | 11:55 | 0.01 | 19.17 | 0.0 | 11:56 | 0.000 | 15.40 | 2698463.5 | 230905.720 | [(2698463.5, 230905.72)] |
D66_36.D.7.C.1_19 | 19.320000 | 3.335760 | 5.0 | 6028.0 | JUNCTION | 0.57 | 3.38 | 22.70 | 0 | 12:00 | 0.49 | 6.45 | 0.0 | 11:51 | 0.008 | 3.38 | 2691999.0 | 230309.563 | [(2691999.0, 230309.563)] |
Warning
-Using all cores for simultaneous model runs can put your machine's CPU usage at 100% for extended periods of time. This probably puts stress on your hardware. Use at your own risk.
-Warning
-Using all cores for simultaneous model runs can put your machine's CPU usage at 100% for extended periods of time. This probably puts stress on your hardware. Use at your own risk.
-\n", + " | InletNode | \n", + "OutletNode | \n", + "Length | \n", + "Roughness | \n", + "InOffset | \n", + "OutOffset | \n", + "InitFlow | \n", + "... | \n", + "Shape | \n", + "Geom1 | \n", + "Geom2 | \n", + "Geom3 | \n", + "Geom4 | \n", + "Barrels | \n", + "coords | \n", + "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Name | \n", + "\n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " |
C1:C2 | \n", + "J1 | \n", + "J2 | \n", + "244.63 | \n", + "0.01 | \n", + "0.0 | \n", + "0.0 | \n", + "0.0 | \n", + "... | \n", + "CIRCULAR | \n", + "1.0 | \n", + "0.0 | \n", + "0.0 | \n", + "0.0 | \n", + "1.0 | \n", + "[(0.0, 0.0), (238.75, -53.332)] | \n", + "
C3 | \n", + "J3 | \n", + "J4 | \n", + "NaN | \n", + "NaN | \n", + "NaN | \n", + "NaN | \n", + "NaN | \n", + "... | \n", + "RECT_OPEN | \n", + "5.0 | \n", + "1.0 | \n", + "0.0 | \n", + "0.0 | \n", + "NaN | \n", + "[(459.058, -113.145), (671.391, -163.985)] | \n", + "
C2 | \n", + "J2 | \n", + "J3 | \n", + "NaN | \n", + "NaN | \n", + "NaN | \n", + "NaN | \n", + "NaN | \n", + "... | \n", + "NaN | \n", + "NaN | \n", + "NaN | \n", + "NaN | \n", + "NaN | \n", + "NaN | \n", + "[(238.75, -53.332), (459.058, -113.145)] | \n", + "
3 rows × 26 columns
\n", + "\n", + " | InvertElev | \n", + "OutfallType | \n", + "StageOrTimeseries | \n", + "
---|---|---|---|
Name | \n", + "\n", + " | \n", + " | \n", + " |
J4 | \n", + "0 | \n", + "FREE | \n", + "NO | \n", + "
\n", + " | InvertElev | \n", + "OutfallType | \n", + "StageOrTimeseries | \n", + "
---|---|---|---|
Name | \n", + "\n", + " | \n", + " | \n", + " |
J4 | \n", + "0 | \n", + "FIXED | \n", + "3.0 | \n", + "
\n", + " | InvertElev | \n", + "OutfallType | \n", + "StageOrTimeseries | \n", + "
---|---|---|---|
Name | \n", + "\n", + " | \n", + " | \n", + " |
J1 | \n", + "20.728 | \n", + "NaN | \n", + "NaN | \n", + "
J3 | \n", + "6.547 | \n", + "NaN | \n", + "NaN | \n", + "
J4 | \n", + "0.000 | \n", + "FIXED | \n", + "3.0 | \n", + "
J2 | \n", + "13.392 | \n", + "NaN | \n", + "NaN | \n", + "
\n", + " | InvertElev | \n", + "OutfallType | \n", + "StageOrTimeseries | \n", + "
---|---|---|---|
Name | \n", + "\n", + " | \n", + " | \n", + " |
KRO2005 | \n", + "574.32 | \n", + "FIXED | \n", + "581.0 | \n", + "
PSO | \n", + "548.36 | \n", + "FIXED | \n", + "581.0 | \n", + "
\n", + " | InvertElev | \n", + "MaxDepth | \n", + "InitDepth | \n", + "SurchargeDepth | \n", + "geometry | \n", + "
---|---|---|---|---|---|
Name | \n", + "\n", + " | \n", + " | \n", + " | \n", + " | \n", + " |
KRO3001 | \n", + "556.19 | \n", + "10.0 | \n", + "0.0 | \n", + "0.0 | \n", + "POINT (1362408.25 431113.81) | \n", + "
KRO6015 | \n", + "585.98 | \n", + "8.0 | \n", + "0.0 | \n", + "0.0 | \n", + "POINT (1362748.63 428675.19) | \n", + "
KRO6016 | \n", + "584.14 | \n", + "9.0 | \n", + "0.0 | \n", + "0.0 | \n", + "POINT (1362767 428813.59) | \n", + "
KRO6017 | \n", + "582.01 | \n", + "14.0 | \n", + "0.0 | \n", + "0.0 | \n", + "POINT (1363087.25 428778.19) | \n", + "
KRO1002 | \n", + "594.89 | \n", + "3.0 | \n", + "0.0 | \n", + "0.0 | \n", + "POINT (1362361.78 429189.37) | \n", + "
\n", + " | InvertElev | \n", + "OutfallType | \n", + "StageOrTimeseries | \n", + "CountUpstreamNodes | \n", + "
---|---|---|---|---|
Name | \n", + "\n", + " | \n", + " | \n", + " | \n", + " |
OT058435 | \n", + "99.069000 | \n", + "FREE | \n", + "NO | \n", + "2201 | \n", + "
SW057333 | \n", + "96.186479 | \n", + "FREE | \n", + "NO | \n", + "2134 | \n", + "
SW050430 | \n", + "91.518354 | \n", + "FREE | \n", + "NO | \n", + "2129 | \n", + "
OT057101 | \n", + "106.086000 | \n", + "FREE | \n", + "NO | \n", + "1866 | \n", + "
OT055333 | \n", + "105.243018 | \n", + "FREE | \n", + "NO | \n", + "1753 | \n", + "
SW052128 | \n", + "128.070000 | \n", + "FREE | \n", + "NO | \n", + "669 | \n", + "
OT114327 | \n", + "0.000000 | \n", + "FREE | \n", + "NO | \n", + "344 | \n", + "
SW058436_OUT1 | \n", + "102.400000 | \n", + "FREE | \n", + "NO | \n", + "183 | \n", + "
OC-SYCAMORE | \n", + "175.500000 | \n", + "FREE | \n", + "NO | \n", + "163 | \n", + "
IDM_EUCLID30 | \n", + "127.166719 | \n", + "FREE | \n", + "NO | \n", + "158 | \n", + "