swmmio.inp#
- class swmmio.core.inp(file_path)[source]#
 - Attributes:
 aquifersGet/set the aquifers section of the INP file.
buildupGet/set buildup section of the INP file.
conduitsGet/set conduits section of the INP file.
controlsGet/set controls section of the model
coordinatesGet/set coordinates section of model
coveragesGet/set coverages section of the INP file.
curvesget/set curves section of model
dividersGet/set dividers section of the INP file.
dwfGet/set DWF section of model
evaporationget/set evaporation section of model
filesGet/set files section of the INP file.
groundwaterGet/set the groundwater section of the INP file.
headersReturn all headers and associated column names found in the INP file.
hydrographsGet/set hydrographs section of the INP file.
infiltrationGet/set infiltration section of the INP file.
inflowsGet/set inflows section of model
inlet_usageGet/set inlet usage section of the INP file.
inletsGet/set inlets section of the INP file.
junctionsGet/set junctions section of the INP file.
landusesGet/set landuses section of the INP file.
lid_usageGet/set LID_USAGE section of the INP file.
loadingsGet/set loadings section of the INP file.
lossesget/set losses section of model
optionsGet/set options section of the INP file.
orificesGet/set orifices section of the INP file.
outfallsGet/set outfalls section of the INP file.
outletsGet/set outlets section of the INP file.
patternsGet/set patterns section of the model
pollutantsget/set pollutants section of model
polygonsget/set polygons section of model
pumpsGet/set pumps section of the INP file.
raingagesget/set raingages section of model
rdiiGet/set RDII section of the INP file.
reportGet/set report section of the INP file.
storageGet/set storage section of the INP file.
streetsGet/set streets section of the INP file.
subareasGet/set subareas section of the INP file.
subcatchmentsGet/set subcatchments section of the INP file.
tagsGet/set tags section of the INP file.
timeseriesget/set timeseries section of model
verticesget/set vertices section of model
washoffGet/set washoff section of the INP file.
weirsGet/set weirs section of the INP file.
xsectionsGet/set xsections section of the INP file.
Methods
save([target_path])Save the inp file to disk.
validate()Detect and remove invalid model elements
trim_to_nodes
- property aquifers#
 Get/set the aquifers section of the INP file.
>>> from swmmio.examples import groundwater >>> groundwater.inp.aquifers.loc['1'] Por 0.500 WP 0.150 FC 0.300 Ksat 0.100 Kslope 12.000 Tslope 15.000 ETu 0.350 ETs 14.000 Seep 0.002 Ebot 0.000 Egw 3.500 Umc 0.400 Name: 1, dtype: float64
- property buildup#
 Get/set buildup section of the INP file.
Examples:
>>> from swmmio.examples import walnut >>> walnut.inp.buildup[['Pollutant', 'Function', 'Normalizer']] Pollutant Function Normalizer LandUse Residential Lead NONE AREA Residential TSS SAT AREA Undeveloped Lead NONE AREA Undeveloped TSS SAT AREA
- property conduits#
 Get/set conduits section of the INP file.
- Returns:
 Conduits section of the INP file
- Return type:
 
Examples:
>>> import swmmio >>> from swmmio.tests.data import MODEL_FULL_FEATURES__NET_PATH >>> model = swmmio.Model(MODEL_FULL_FEATURES__NET_PATH) >>> model.inp.conduits[['InletNode', 'OutletNode', 'Length', 'Roughness']] InletNode OutletNode Length Roughness Name C1:C2 J1 J2 244.63 0.01 C2.1 J2 J3 666.00 0.01 1 1 4 400.00 0.01 2 4 5 400.00 0.01 3 5 J1 400.00 0.01 4 3 4 400.00 0.01 5 2 5 400.00 0.01
- property controls#
 Get/set controls section of the model
- Returns:
 dataframe of controls
>>> from swmmio.examples import pump_control >>> pump_control.inp.controls Control Name RULE PUMP1A IF NODE SU1 DEPTH >= 4 THEN PUMP PUMP1 status = ON PRIORITY 1 RULE PUMP1B IF NODE SU1 DEPTH < 1 THEN PUMP PUMP1 status = OFF PRIORITY 1
- property coordinates#
 Get/set coordinates section of model :return: dataframe of model coordinates
- property coverages#
 Get/set coverages section of the INP file.
Examples:
>>> from swmmio.examples import walnut >>> walnut.inp.coverages LandUse Percent Subcatchment 1 Residential 100.0 2 Residential 50.0 2 Undeveloped 50.0 3 Residential 100.0 4 Residential 50.0 4 Undeveloped 50.0 5 Residential 100.0 6 Undeveloped 100.0 7 Undeveloped 100.0 8 Undeveloped 100.0
- property curves#
 get/set curves section of model :return: multi-index dataframe of model curves
- property dividers#
 Get/set dividers section of the INP file.
- Returns:
 dividers section of the INP file
- Return type:
 
>>> from swmmio.examples import spruce >>> spruce.inp.dividers Elevation Diverted Link Type Parameters Name NODE5 3.0 C6 CUTOFF 1.0
- property dwf#
 Get/set DWF section of model :return: dataframe of model DWF section
- property evaporation#
 get/set evaporation section of model
- Returns:
 dataframe of evaporation section in inp file
Examples:
>>> from swmmio.examples import walnut >>> walnut.inp.evaporation Value Key CONSTANT 0.0 DRY_ONLY NO
- property files#
 Get/set files section of the INP file.
- Returns:
 files section of the INP file
- Return type:
 
- property groundwater#
 Get/set the groundwater section of the INP file.
>>> from swmmio.examples import groundwater >>> groundwater.inp.groundwater.loc['1'] Aquifer 1.0 Node 2.0 Esurf 6.0 A1 0.1 B1 1.0 A2 0.0 B2 0.0 A3 0.0 Dsw 0.0 Egwt 4.0 Name: 1, dtype: float64
- property headers#
 Return all headers and associated column names found in the INP file.
- property hydrographs#
 Get/set hydrographs section of the INP file.
Examples:
>>> from swmmio.examples import walnut >>> walnut.inp.hydrographs RainGage/Month Hydrograph Hydrograph1 TS1
- property infiltration#
 Get/set infiltration section of the INP file.
>>> import swmmio >>> from swmmio.tests.data import MODEL_FULL_FEATURES__NET_PATH >>> m = swmmio.Model(MODEL_FULL_FEATURES__NET_PATH) >>> m.inp.infiltration MaxRate MinRate Decay DryTime MaxInfil Subcatchment S1 3.0 0.5 4 7 0 S2 3.0 0.5 4 7 0 S3 3.0 0.5 4 7 0 S4 3.0 0.5 4 7 0
- property inflows#
 Get/set inflows section of model
- Returns:
 dataframe of nodes with inflows
>>> from swmmio.examples import jersey >>> jersey.inp.inflows[['Constituent', 'Mfactor', 'Baseline']] Constituent Mfactor Baseline Node J3 Flow 1.0 1 J2 FLOW 1.0 1 J1 FLOW 1.0 1
- property inlet_usage#
 Get/set inlet usage section of the INP file.
- Returns:
 - pandas.DataFrame
 
Examples
Access the inlet usage section of the inp file
>>> from swmmio.examples import streets >>> streets.inp.inlet_usage[['Inlet', 'Node', 'Number', '%Clogged']] Inlet Node Number %Clogged Link Street1 ComboInlet J1 1 50 Street3 ComboInlet J2a 1 0 Street4 ComboInlet J2 1 0 Street5 ComboInlet J11 2 0
- property inlets#
 Get/set inlets section of the INP file.
- Returns:
 - pandas.DataFrame
 
Examples
Access the inlets section of the inp file
>>> from swmmio.examples import streets >>> streets.inp.inlets Type Param1 Param2 Param3 Name ComboInlet GRATE 2 2.0 P_BAR-50 ComboInlet CURB 2 0.5 HORIZONTAL
- property junctions#
 Get/set junctions section of the INP file.
- Returns:
 junctions section of the INP file
- Return type:
 
Examples:
>>> import swmmio >>> from swmmio.tests.data import MODEL_FULL_FEATURES__NET_PATH >>> model = swmmio.Model(MODEL_FULL_FEATURES__NET_PATH) >>> model.inp.junctions InvertElev MaxDepth InitDepth SurchargeDepth PondedArea Name J3 6.547 15 0 0 0 1 17.000 0 0 0 0 2 17.000 0 0 0 0 3 16.500 0 0 0 0 4 16.000 0 0 0 0 5 15.000 0 0 0 0 J2 13.000 15 0 0 0
- property landuses#
 Get/set landuses section of the INP file.
Examples:
>>> from swmmio.examples import walnut >>> walnut.inp.landuses CleaningInterval FractionAvailable LastCleaned Name Residential 0 0 0 Undeveloped 0 0 0
- property lid_usage#
 Get/set LID_USAGE section of the INP file.
- property loadings#
 Get/set loadings section of the INP file.
- property losses#
 get/set losses section of model
- Returns:
 dataframe of evaporation section in inp file
>>> from swmmio.examples import spruce >>> spruce.inp.losses Inlet Outlet Average Flap Gate SeepageRate Link C1:C2 0 0 0 YES 0 C2.1 0 0 0 YES 0
- property options#
 Get/set options section of the INP file.
- Returns:
 options section of the INP file
- Return type:
 
>>> import swmmio >>> from swmmio.tests.data import MODEL_FULL_FEATURES_XY >>> model = swmmio.Model(MODEL_FULL_FEATURES_XY) >>> model.inp.options.loc['INFILTRATION'] Value HORTON Name: INFILTRATION, dtype: object >>> model.inp.headers['[INFILTRATION]'] ['Subcatchment', 'MaxRate', 'MinRate', 'Decay', 'DryTime', 'MaxInfil'] >>> model.inp.options.loc['INFILTRATION', 'Value'] = 'GREEN_AMPT' >>> model.inp.headers['[INFILTRATION]'] ['Subcatchment', 'Suction', 'HydCon', 'IMDmax', 'Param4', 'Param5']
- property orifices#
 Get/set orifices section of the INP file.
- property outfalls#
 Get/set outfalls section of the INP file.
- Returns:
 outfalls section of the INP file
- Return type:
 
Examples:
>>> import swmmio >>> from swmmio.tests.data import MODEL_FULL_FEATURES__NET_PATH >>> model = swmmio.Model(MODEL_FULL_FEATURES__NET_PATH) >>> model.inp.outfalls InvertElev OutfallType StageOrTimeseries Name J4 0 FREE NO
- property outlets#
 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'] InletNode J11 OutletNode O1 OutflowHeight 0 OutletType FUNCTIONAL/DEPTH Qcoeff/QTable 10 Qexpon 0.5 FlapGate NO Name: C11, dtype: object
- property patterns#
 Get/set patterns section of the model
- Returns:
 dataframe of patterns
>>> from swmmio.examples import pump_control >>> # NOTE, only the first 5 columns are shown in the following example >>> pump_control.inp.patterns.iloc[:,0:5] Type Factor1 Factor2 Factor3 Factor4 Name DWF HOURLY 0.0151 0.01373 0.01812 0.01098
- property pollutants#
 get/set pollutants section of model
- Returns:
 dataframe of pollutants section in inp file
Examples: The walnut example model contains two entries in the POLLUTANTS section, one of which is TSS. Below we show how to retrieve this information, by accessing the TSS index of the pollutants dataframe:
>>> from swmmio.examples import walnut >>> walnut.inp.pollutants.loc['TSS'] MassUnits MG/L RainConcen 0.0 GWConcen 0.0 I&IConcen 0 DecayCoeff 0.0 SnowOnly NO CoPollutName * CoPollutFraction 0.0 DWFConcen 0 InitConcen 0 Name: TSS, dtype: object
- property polygons#
 get/set polygons section of model :return: dataframe of model coordinates
- property pumps#
 Get/set pumps section of the INP file.
- property raingages#
 get/set raingages section of model
- Returns:
 dataframe of raingages in the model
Examples:
>>> from swmmio.examples import philly >>> philly.inp.raingages RainType TimeIntrvl SnowCatch DataSource DataSourceName Name RG1 INTENSITY 1:00 1.0 TIMESERIES design-storm
- property rdii#
 Get/set RDII section of the INP file.
Examples:
>>> from swmmio.examples import walnut >>> walnut.inp.rdii UnitHydrograph SewerArea Node 13 Hydrograph1 58.944186 14 Hydrograph1 58.944186
- property report#
 Get/set report section of the INP file.
- Returns:
 report section of the INP file
- Return type:
 
>>> from swmmio.examples import jersey >>> jersey.inp.report Status Param INPUT YES CONTROLS YES SUBCATCHMENTS NONE NODES ALL LINKS NONE
- save(target_path=None)[source]#
 Save the inp file to disk. File will be overwritten unless a target_path is provided
- Parameters:
 target_path – optional path to new inp file
- Returns:
 None
>>> from swmmio.examples import philly >>> philly.inp.save('copy-of-philly.inp')
- property storage#
 Get/set storage section of the INP file.
- Returns:
 storage section of the INP file
- Return type:
 
Examples:
- property streets#
 Get/set streets section of the INP file.
- Returns:
 - pandas.DataFrame
 
Examples
Access the streets section of the inp file
>>> from swmmio.examples import streets >>> streets.inp.streets[['Tcrown', 'Hcurb']] Tcrown Hcurb Name HalfStreet 20 0.5 FullStreet 20 0.5
- property subareas#
 Get/set subareas section of the INP file.
- property subcatchments#
 Get/set subcatchments section of the INP file.
- Returns:
 subcatchments section of the INP file
- Return type:
 
Examples:
- property tags#
 Get/set tags section of the INP file.
- property timeseries#
 get/set timeseries section of model :return: multi-index dataframe of model curves
- property vertices#
 get/set vertices section of model :return: dataframe of model coordinates
- property washoff#
 Get/set washoff section of the INP file.
Examples:
>>> from swmmio.examples import walnut >>> walnut.inp.washoff[['Pollutant', 'Function']] Pollutant Function LandUse Residential Lead EMC Residential TSS EXP Undeveloped Lead EMC Undeveloped TSS EXP
- property weirs#
 Get/set weirs section of the INP file.
- property xsections#
 Get/set xsections section of the INP file.