diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 212a8d9..2160f1e 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -44,7 +44,7 @@ jobs: path: './docs/build' deploy: - # if: startsWith(github.event.ref, 'refs/tags/v') + if: startsWith(github.event.ref, 'refs/tags/v') environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} diff --git a/swmmio/core.py b/swmmio/core.py index 2da7c5b..49a3839 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,39 @@ 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.loc['C11'] #doctest: +NORMALIZE_WHITESPACE + InletNode J11 + OutletNode O1 + OutflowHeight 0 + OutletType FUNCTIONAL/DEPTH + Qcoeff/QTable 10 + Qexpon 0.5 + FlapGate NO + Name: C11, dtype: object + """ + 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..65a8d83 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, OUTLETS] 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..b73500f 100644 --- a/swmmio/tests/data/test_inlet_drains.inp +++ b/swmmio/tests/data/test_inlet_drains.inp @@ -129,7 +129,6 @@ C7 J6 J8 95.0 0.016 0 C8 J8 J9 166.0 0.05 0 0 0 0 C9 J9 J10 320.0 0.05 0 6 0 0 C10 J10 J11 145.0 0.05 6 6 0 0 -C11 J11 O1 89.0 0.016 0 0 0 0 C_Aux3 Aux3 J3 444.75 0.05 6 0 0 0 P1 J1 J5 185.39 0.016 0 0 0 0 P2 J2a J2 157.48 0.016 0 0 0 0 @@ -140,6 +139,12 @@ P6 J4 J7 360.39 0.016 0 P7 J7 J10 507.76 0.016 0 0 0 0 P8 J10 J11 144.50 0.016 0 0 0 0 +[OUTLETS] +;;Name From Node To Node Offset Type QTable/Qcoeff Qexpon Gated +;;-------------- ---------------- ---------------- ---------- ---------------- ---------------- ---------- -------- +C11 J11 O1 0 FUNCTIONAL/DEPTH 10 0.5 NO + + [XSECTIONS] ;;Link Shape Geom1 Geom2 Geom3 Geom4 Barrels Culvert ;;-------------- ------------ ---------------- ---------- ---------- ---------- ---------- ---------- @@ -156,7 +161,6 @@ C7 CIRCULAR 3.5 0 0 0 C8 TRAPEZOIDAL 3 5 5 5 1 C9 TRAPEZOIDAL 3 5 5 5 1 C10 TRAPEZOIDAL 3 5 5 5 1 -C11 CIRCULAR 4.75 0 0 0 1 C_Aux3 TRAPEZOIDAL 3 5 5 5 1 P1 CIRCULAR 0.5 0 0 0 1 P2 CIRCULAR 1.5 0 0 0 1