Skip to content

Commit

Permalink
partial implementation of outlets inp coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
aerispaha committed Nov 13, 2024
1 parent c93d77b commit 77ab19d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
30 changes: 30 additions & 0 deletions swmmio/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@ def __init__(self, file_path):
self._tags_df = None
self._streets_df = None
self._inlets_df = None
self._outlets_df = None
self._inlet_usage_df = None
self._patterns_df = None
self._controls_df = None
Expand Down Expand Up @@ -645,6 +646,7 @@ def __init__(self, file_path):
'[TAGS]',
'[STREETS]',
'[INLETS]',
'[OUTLETS]',
'[INLET_USAGE]',
'[PATTERNS]',
'[CONTROLS]',
Expand Down Expand Up @@ -1677,6 +1679,34 @@ def inlets(self):
def inlets(self, df):
"""Set inp.inlets DataFrame."""
self._inlets_df = df

@property
def outlets(self):
"""
Get/set outlets section of the INP file.
Returns
-------
pandas.DataFrame
Examples
--------
Access the outlets section of the inp file
>>> from swmmio.examples import streets
>>> streets.inp.outlets #doctest: +NORMALIZE_WHITESPACE
InletNode OutletNode ... Qcoeff/QTable Qexpon
Name ...
TestOutlet J100 J101 ... TestOutletTB YES
"""
if self._outlets_df is None:
self._outlets_df = dataframe_from_inp(self.path, "[OUTLETS]")
return self._outlets_df

@outlets.setter
def outlets(self, df):
"""Set inp.outlets DataFrame."""
self._outlets_df = df

@property
def inlet_usage(self):
Expand Down
2 changes: 1 addition & 1 deletion swmmio/defs/section_headers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ composite:
rpt_sections: [Link Flow Summary]
outfalls: [Name, Elevation, Type, Stage Data, Gated, Route To]
links:
inp_sections: [CONDUITS, WEIRS, ORIFICES, PUMPS]
inp_sections: [CONDUITS, WEIRS, ORIFICES, PUMPS, OUTFALLS]
join_sections: [XSECTIONS]
rpt_sections: [Link Flow Summary]
pumps:
Expand Down
5 changes: 5 additions & 0 deletions swmmio/tests/data/test_inlet_drains.inp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ Street3 ComboInlet J2a 1 0 0
Street4 ComboInlet J2 1 0 0 0 0
Street5 ComboInlet J11 2 0 0 0 0

[OUTLETS]
;;Name From Node To Node Offset Type QTable/Qcoeff Qexpon Gated
;;-------------- ---------------- ---------------- ---------- --------------- ---------------- ---------- --------
TestOutlet J100 J101 1.07 TABULAR/DEPTH TestOutletTB YES

[TIMESERIES]
;;Name Date Time Value
;;-------------- ---------- ---------- ----------
Expand Down

0 comments on commit 77ab19d

Please sign in to comment.