diff --git a/swmmio/core.py b/swmmio/core.py index 2da7c5b..cf9d89f 100644 --- a/swmmio/core.py +++ b/swmmio/core.py @@ -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 @@ -645,6 +646,7 @@ def __init__(self, file_path): '[TAGS]', '[STREETS]', '[INLETS]', + '[OUTLETS]', '[INLET_USAGE]', '[PATTERNS]', '[CONTROLS]', @@ -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): diff --git a/swmmio/defs/section_headers.yml b/swmmio/defs/section_headers.yml index f93658a..8b28151 100644 --- a/swmmio/defs/section_headers.yml +++ b/swmmio/defs/section_headers.yml @@ -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: diff --git a/swmmio/tests/data/test_inlet_drains.inp b/swmmio/tests/data/test_inlet_drains.inp index f224c4b..d775707 100644 --- a/swmmio/tests/data/test_inlet_drains.inp +++ b/swmmio/tests/data/test_inlet_drains.inp @@ -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 ;;-------------- ---------- ---------- ----------