swmmx Documentation

Complete Add Reference

Rendered from 13_all_add_functions.ipynb.

swmmx: all add functions

This notebook is a categorized reference for every public add endpoint in swmmx.

Add pattern:

m.add.<category>.<element_type>(id, **options)
  • The first argument is always the new object ID.
  • Implemented endpoints create records, mark the model modified, and invalidate stale results.
  • Reserved endpoints are intentionally visible for autocomplete but raise NotImplementedYetError until implemented.
  • Node-like additions require explicit x/y map coordinates.
  • Subcatchments require explicit centroid x/y; an optional polygon can still define their outline.
Code cell 1
from swmmx import swmm

m = swmm(new='SI')
# Build on this scratch model when trying the examples below.

Common add patterns

m.add.node.junction('J1', x=0.0, y=0.0, invert_elevation=10.0, max_depth=3.0)
m.add.node.outfall('OUT1', x=100.0, y=0.0, invert_elevation=9.0, type='FREE')
m.add.link.conduit('C1', from_node='J1', to_node='OUT1', roughness=0.013)
m.add.hydrology.subcatchment('S1', rain_gage='RG1', outlet='J1', x=0.0, y=0.0)

Hydrology

hydrology

Add functionStatusRequired inputsOptional inputsCoordinate ruleOutputConditions
m.add.hydrology.rain_gage(...)Implementedid, format, interval, source_typex, y, snow_catch_factor, time_series, filename, station, unitsOptional x/y; defaults to maximum mapped pointcreated object ID (str)Requires format, interval, and source_type; time_series is checked when used.
m.add.hydrology.subcatchment(...)Implementedid, rain_gage, outlet, x, yarea, width, slope, impervious_percent, curb_length, snow_pack, polygon, n_impervious, n_pervious, depression_storage_impervious, depression_storage_pervious, zero_depression_storage_impervious_percent, subarea_routing, percent_routed, maximum_rate, minimum_rate, decay, dry_time, maximum_volume, suction_head, hydraulic_conductivity, initial_moisture_deficit, curve_number, conductivityExplicit centroid x/y requiredcreated object ID (str)Requires explicit centroid x/y; outlet may be a node or another subcatchment.
m.add.hydrology.aquifer(...)Reserved; raises NotImplementedYetErroridporosity, wilting_point, field_capacity, conductivity, conductivity_slope, tension_slope, upper_evaporation_fraction, lower_evaporation_depth, lower_groundwater_loss_rate, bottom_elevation, water_table_elevation, unsaturated_moisture, upper_evaporation_patternNonecreated object ID (str)Use the listed required inputs; unsupported reserved endpoints raise a clear error.
m.add.hydrology.snow_pack(...)Reserved; raises NotImplementedYetErroridplowable_fraction, impervious_fraction, pervious_fraction, minimum_melt_coefficient, maximum_melt_coefficient, base_temperature, free_water_capacity_fraction, initial_snow_depth, initial_free_water, depth_at_100_percent_coverNonecreated object ID (str)Use the listed required inputs; unsupported reserved endpoints raise a clear error.
m.add.hydrology.unit_hydrograph(...)Reserved; raises NotImplementedYetErrorid, rain_gage, datamonth, short_term_r, short_term_t, short_term_k, medium_term_r, medium_term_t, medium_term_k, long_term_r, long_term_t, long_term_kNonecreated object ID (str)Use the listed required inputs; unsupported reserved endpoints raise a clear error.
m.add.hydrology.lid_control(...)Reserved; raises NotImplementedYetErrorid, typeparameters, surface, pavement, soil, storage, drain, drain_matNonecreated object ID (str)Use the listed required inputs; unsupported reserved endpoints raise a clear error.
m.add.hydrology.rain_gage()

Add a rainfall gage and its map symbol.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
formatRequired keywordstr enumNoneValidated according to the element definition
intervalRequired keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
source_typeRequired keywordstr enumNoneValidated according to the element definition
xOptional keywordfloatNoneValidated according to the element definition
yOptional keywordfloatNoneValidated according to the element definition
snow_catch_factorOptional keywordvalue compatible with the named SWMM field1.0Validated according to the element definition
time_seriesOptional keywordstr ID of existing time_series objectNoneMust reference an existing time_series object
filenameOptional keywordstrNoneUsed when source_type='FILE'
stationOptional keywordstrNoneValidated according to the element definition
unitsOptional keywordstrNoneValidated according to the element definition
  • INP sections: RAINGAGES, SYMBOLS
  • Reference checks: time_series -> time_series
  • Removal dependency rules: subcatchment.rain_gage
  • Implementation status: Implemented
  • Example: m.add.hydrology.rain_gage("RG1", format="INTENSITY", interval="00:05", source_type="TIMESERIES", time_series="Rain1")
m.add.hydrology.subcatchment()

Add a subcatchment with subarea and infiltration records.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
rain_gageRequired keywordstr ID of existing rain_gage objectNoneMust reference an existing rain_gage object
outletRequired keywordstr ID of existing node_or_subcatchment objectNoneMust reference an existing node_or_subcatchment object
xRequired keywordfloatNoneRequired subcatchment centroid coordinate
yRequired keywordfloatNoneRequired subcatchment centroid coordinate
areaOptional keywordfloat0.0Validated according to the element definition
widthOptional keywordfloat0.0Validated according to the element definition
slopeOptional keywordfloat0.0Validated according to the element definition
impervious_percentOptional keywordfloat0.0Validated according to the element definition
curb_lengthOptional keywordvalue compatible with the named SWMM field0.0Validated according to the element definition
snow_packOptional keywordstr ID of existing snow_pack objectNoneMust reference an existing snow_pack object
polygonOptional keywordlist[tuple[float, float]], pandas DataFrame, or NumPy (n, 2) arrayNoneOptional outline; fallback polygon is centered on x/y
n_imperviousOptional keywordvalue compatible with the named SWMM field0.01Validated according to the element definition
n_perviousOptional keywordvalue compatible with the named SWMM field0.1Validated according to the element definition
depression_storage_imperviousOptional keywordfloat0.05Validated according to the element definition
depression_storage_perviousOptional keywordfloat0.05Validated according to the element definition
zero_depression_storage_impervious_percentOptional keywordfloat25.0Validated according to the element definition
subarea_routingOptional keywordfloat'OUTLET'Validated according to the element definition
percent_routedOptional keywordfloatNoneValidated according to the element definition
maximum_rateOptional keywordfloatNoneValidated according to the element definition
minimum_rateOptional keywordfloatNoneValidated according to the element definition
decayOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
dry_timeOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
maximum_volumeOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
suction_headOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
hydraulic_conductivityOptional keywordfloatNoneValidated according to the element definition
initial_moisture_deficitOptional keywordfloatNoneValidated according to the element definition
curve_numberOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
conductivityOptional keywordfloatNoneValidated according to the element definition
  • INP sections: SUBCATCHMENTS, SUBAREAS, INFILTRATION, POLYGONS
  • Reference checks: rain_gage -> rain_gage, outlet -> node_or_subcatchment, snow_pack -> snow_pack
  • Removal dependency rules: subcatchment.outlet
  • Implementation status: Implemented
  • Example: m.add.hydrology.subcatchment("S1", rain_gage="RG1", outlet="J1", x=0.0, y=0.0, area=1.0)
m.add.hydrology.aquifer()

Reserve an aquifer definition.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
porosityOptional keywordfloatNoneValidated according to the element definition
wilting_pointOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
field_capacityOptional keywordfloatNoneValidated according to the element definition
conductivityOptional keywordfloatNoneValidated according to the element definition
conductivity_slopeOptional keywordfloatNoneValidated according to the element definition
tension_slopeOptional keywordfloatNoneValidated according to the element definition
upper_evaporation_fractionOptional keywordfloatNoneValidated according to the element definition
lower_evaporation_depthOptional keywordfloatNoneValidated according to the element definition
lower_groundwater_loss_rateOptional keywordfloatNoneValidated according to the element definition
bottom_elevationOptional keywordfloatNoneValidated according to the element definition
water_table_elevationOptional keywordfloatNoneValidated according to the element definition
unsaturated_moistureOptional keywordfloatNoneValidated according to the element definition
upper_evaporation_patternOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
  • INP sections: AQUIFERS
  • Reference checks: None
  • Removal dependency rules: None
  • Implementation status: Reserved; raises NotImplementedYetError
  • Example: m.add.hydrology.aquifer("ID", ...)
m.add.hydrology.snow_pack()

Reserve a snow-pack definition.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
plowable_fractionOptional keywordfloatNoneValidated according to the element definition
impervious_fractionOptional keywordfloatNoneValidated according to the element definition
pervious_fractionOptional keywordfloatNoneValidated according to the element definition
minimum_melt_coefficientOptional keywordfloatNoneValidated according to the element definition
maximum_melt_coefficientOptional keywordfloatNoneValidated according to the element definition
base_temperatureOptional keywordfloatNoneValidated according to the element definition
free_water_capacity_fractionOptional keywordfloatNoneValidated according to the element definition
initial_snow_depthOptional keywordfloatNoneValidated according to the element definition
initial_free_waterOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
depth_at_100_percent_coverOptional keywordfloatNoneValidated according to the element definition
  • INP sections: SNOWPACKS
  • Reference checks: None
  • Removal dependency rules: None
  • Implementation status: Reserved; raises NotImplementedYetError
  • Example: m.add.hydrology.snow_pack("ID", ...)
m.add.hydrology.unit_hydrograph()

Reserve an RDII unit hydrograph definition.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
rain_gageRequired positionalstr ID of existing rain_gage objectNoneMust reference an existing rain_gage object
dataRequired positionaltime/value pairs, pandas Series/DataFrame, or compatible array-like dataNoneValidated according to the element definition
monthOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
short_term_rOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
short_term_tOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
short_term_kOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
medium_term_rOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
medium_term_tOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
medium_term_kOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
long_term_rOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
long_term_tOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
long_term_kOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
  • INP sections: HYDROGRAPHS
  • Reference checks: rain_gage -> rain_gage
  • Removal dependency rules: None
  • Implementation status: Reserved; raises NotImplementedYetError
  • Example: m.add.hydrology.unit_hydrograph("ID", ...)
m.add.hydrology.lid_control()

Reserve a multi-layer LID control definition.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
typeRequired positionalstr enumNoneValidated according to the element definition
parametersOptional positionaldict or structured layer dataNoneValidated according to the element definition
surfaceOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
pavementOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
soilOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
storageOptional keywordfloatNoneValidated according to the element definition
drainOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
drain_matOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
  • INP sections: LID_CONTROLS
  • Reference checks: None
  • Removal dependency rules: None
  • Implementation status: Reserved; raises NotImplementedYetError
  • Example: m.add.hydrology.lid_control("ID", ...)

Nodes

node

Add functionStatusRequired inputsOptional inputsCoordinate ruleOutputConditions
m.add.node.junction(...)Implementedid, x, yinvert_elevation, max_depth, initial_depth, surcharge_depth, ponded_areaExplicit x/y requiredcreated object ID (str)Requires explicit map x/y coordinates.
m.add.node.outfall(...)Implementedid, x, yinvert_elevation, type, fixed_stage, tidal_curve, time_series, tide_gate, route_toExplicit x/y requiredcreated object ID (str)Requires explicit map x/y; stage input depends on outfall type.
m.add.node.divider(...)Reserved; raises NotImplementedYetErrorid, x, yinvert_elevation, max_depth, initial_depth, surcharge_depth, ponded_area, type, diverted_link, cutoff_flow, diversion_curve, weir_height, weir_coefficientExplicit x/y requiredcreated object ID (str)Use the listed required inputs; unsupported reserved endpoints raise a clear error.
m.add.node.storage_unit(...)Reserved; raises NotImplementedYetErrorid, x, yinvert_elevation, max_depth, initial_depth, storage_curve_type, storage_curve, area, area_coefficient, area_exponent, area_constant, evaporation_factor, seepage_lossExplicit x/y requiredcreated object ID (str)Use the listed required inputs; unsupported reserved endpoints raise a clear error.
m.add.node.junction()

Add a hydraulic junction and a coordinate record.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
xRequired keywordfloatNoneRequired map coordinate for node placement
yRequired keywordfloatNoneRequired map coordinate for node placement
invert_elevationOptional keywordfloat0.0Validated according to the element definition
max_depthOptional keywordfloat0.0Validated according to the element definition
initial_depthOptional keywordfloat0.0Validated according to the element definition
surcharge_depthOptional keywordfloat0.0Validated according to the element definition
ponded_areaOptional keywordfloat0.0Validated according to the element definition
  • INP sections: JUNCTIONS, COORDINATES
  • Reference checks: None
  • Removal dependency rules: link.from_node, link.to_node, subcatchment.outlet
  • Implementation status: Implemented
  • Example: m.add.node.junction("J1", x=0.0, y=0.0, invert_elevation=10.0, max_depth=3.0)
m.add.node.outfall()

Add an outfall and a coordinate record.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
xRequired keywordfloatNoneRequired map coordinate for node placement
yRequired keywordfloatNoneRequired map coordinate for node placement
invert_elevationOptional keywordfloat0.0Validated according to the element definition
typeOptional keywordstr enum'FREE'Validated according to the element definition
fixed_stageOptional keywordvalue compatible with the named SWMM fieldNoneRequired only when type='FIXED'
tidal_curveOptional keywordstr ID of existing curve objectNoneMust reference an existing curve object
time_seriesOptional keywordstr ID of existing time_series objectNoneMust reference an existing time_series object
tide_gateOptional keywordbool or SWMM YES/NO string'NO'Validated according to the element definition
route_toOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
  • INP sections: OUTFALLS, COORDINATES
  • Reference checks: tidal_curve -> curve, time_series -> time_series
  • Removal dependency rules: link.from_node, link.to_node, subcatchment.outlet
  • Implementation status: Implemented
  • Example: m.add.node.outfall("OUT1", x=100.0, y=0.0, invert_elevation=9.0, type="FREE")
m.add.node.divider()

Reserve a flow-divider node definition.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
xRequired keywordfloatNoneRequired map coordinate for node placement
yRequired keywordfloatNoneRequired map coordinate for node placement
invert_elevationOptional keywordfloatNoneValidated according to the element definition
max_depthOptional keywordfloatNoneValidated according to the element definition
initial_depthOptional keywordfloatNoneValidated according to the element definition
surcharge_depthOptional keywordfloatNoneValidated according to the element definition
ponded_areaOptional keywordfloatNoneValidated according to the element definition
typeOptional keywordstr enumNoneValidated according to the element definition
diverted_linkOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
cutoff_flowOptional keywordfloatNoneValidated according to the element definition
diversion_curveOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
weir_heightOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
weir_coefficientOptional keywordfloatNoneValidated according to the element definition
  • INP sections: DIVIDERS, COORDINATES
  • Reference checks: None
  • Removal dependency rules: None
  • Implementation status: Reserved; raises NotImplementedYetError
  • Example: m.add.node.divider("ID", ...)
m.add.node.storage_unit()

Reserve a storage-unit node definition.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
xRequired keywordfloatNoneRequired map coordinate for node placement
yRequired keywordfloatNoneRequired map coordinate for node placement
invert_elevationOptional keywordfloatNoneValidated according to the element definition
max_depthOptional keywordfloatNoneValidated according to the element definition
initial_depthOptional keywordfloatNoneValidated according to the element definition
storage_curve_typeOptional keywordfloatNoneValidated according to the element definition
storage_curveOptional keywordfloatNoneValidated according to the element definition
areaOptional keywordfloatNoneValidated according to the element definition
area_coefficientOptional keywordfloatNoneValidated according to the element definition
area_exponentOptional keywordfloatNoneValidated according to the element definition
area_constantOptional keywordfloatNoneValidated according to the element definition
evaporation_factorOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
seepage_lossOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
  • INP sections: STORAGE, COORDINATES
  • Reference checks: None
  • Removal dependency rules: None
  • Implementation status: Reserved; raises NotImplementedYetError
  • Example: m.add.node.storage_unit("ID", ...)

Links

link

Add functionStatusRequired inputsOptional inputsCoordinate ruleOutputConditions
m.add.link.conduit(...)Implementedid, from_node, to_nodelength, roughness, shape, geometry, diameter, geometry_1, geometry_2, geometry_3, geometry_4, inlet_offset, outlet_offset, initial_flow, maximum_flow, barrels, culvert_code, entry_loss, exit_loss, average_loss, flap_gate, seepage_rate, verticesNonecreated object ID (str)Requires existing endpoint nodes; length can be computed from their coordinates.
m.add.link.pump(...)Reserved; raises NotImplementedYetErrorid, from_node, to_node, curveinitial_status, startup_depth, shutoff_depthNonecreated object ID (str)Use the listed required inputs; unsupported reserved endpoints raise a clear error.
m.add.link.orifice(...)Reserved; raises NotImplementedYetErrorid, from_node, to_node, type, shape, height, discharge_coefficientwidth, offset, flap_gate, open_close_timeNonecreated object ID (str)Use the listed required inputs; unsupported reserved endpoints raise a clear error.
m.add.link.weir(...)Reserved; raises NotImplementedYetErrorid, from_node, to_node, type, crest_height, discharge_coefficientlength, side_slope, flap_gate, end_contractions, end_coefficient, surcharge, road_width, road_surfaceNonecreated object ID (str)Use the listed required inputs; unsupported reserved endpoints raise a clear error.
m.add.link.outlet(...)Reserved; raises NotImplementedYetErrorid, from_node, to_node, rating_typecurve, coefficient, exponent, offset, flap_gateNonecreated object ID (str)Use the listed required inputs; unsupported reserved endpoints raise a clear error.
m.add.link.conduit()

Add a conduit with matching cross-section data.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
from_nodeRequired keywordstr ID of existing node objectNoneMust reference an existing node object
to_nodeRequired keywordstr ID of existing node objectNoneMust reference an existing node object
lengthOptional keywordfloatNoneIf omitted, computed from node coordinates when available; otherwise 1.0
roughnessOptional keywordfloat0.013Validated according to the element definition
shapeOptional keywordstr enum'CIRCULAR'Validated according to the element definition
geometryOptional keywordnumeric sequence of 1 to 4 valuesNoneValidated according to the element definition
diameterOptional keywordfloat1.0Used as circular geometry_1 when no explicit geometry is supplied
geometry_1Optional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
geometry_2Optional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
geometry_3Optional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
geometry_4Optional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
inlet_offsetOptional keywordvalue compatible with the named SWMM field0.0Validated according to the element definition
outlet_offsetOptional keywordvalue compatible with the named SWMM field0.0Validated according to the element definition
initial_flowOptional keywordfloat0.0Validated according to the element definition
maximum_flowOptional keywordfloat0.0Validated according to the element definition
barrelsOptional keywordint1Validated according to the element definition
culvert_codeOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
entry_lossOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
exit_lossOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
average_lossOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
flap_gateOptional keywordbool or SWMM YES/NO stringNoneValidated according to the element definition
seepage_rateOptional keywordfloatNoneValidated according to the element definition
verticesOptional keywordlist[tuple[float, float]], pandas DataFrame, or NumPy (n, 2) arrayNoneValidated according to the element definition
  • INP sections: CONDUITS, XSECTIONS, LOSSES, VERTICES
  • Reference checks: from_node -> node, to_node -> node
  • Removal dependency rules: controls
  • Implementation status: Implemented
  • Example: m.add.link.conduit("C1", from_node="J1", to_node="OUT1", length=100.0, roughness=0.013, shape="CIRCULAR", diameter=1.0)
m.add.link.pump()

Reserve a pump-link definition.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
from_nodeRequired keywordstr ID of existing node objectNoneMust reference an existing node object
to_nodeRequired keywordstr ID of existing node objectNoneMust reference an existing node object
curveRequired keywordstr ID of existing curve objectNoneMust reference an existing curve object
initial_statusOptional keywordstr enumNoneValidated according to the element definition
startup_depthOptional keywordfloatNoneValidated according to the element definition
shutoff_depthOptional keywordfloatNoneValidated according to the element definition
  • INP sections: PUMPS
  • Reference checks: from_node -> node, to_node -> node, curve -> curve
  • Removal dependency rules: None
  • Implementation status: Reserved; raises NotImplementedYetError
  • Example: m.add.link.pump("ID", ...)
m.add.link.orifice()

Reserve an orifice-link definition.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
from_nodeRequired keywordstr ID of existing node objectNoneMust reference an existing node object
to_nodeRequired keywordstr ID of existing node objectNoneMust reference an existing node object
typeRequired keywordstr enumNoneValidated according to the element definition
shapeRequired keywordstr enumNoneValidated according to the element definition
heightRequired keywordfloatNoneValidated according to the element definition
discharge_coefficientRequired keywordfloatNoneValidated according to the element definition
widthOptional keywordfloatNoneValidated according to the element definition
offsetOptional keywordfloatNoneValidated according to the element definition
flap_gateOptional keywordbool or SWMM YES/NO stringNoneValidated according to the element definition
open_close_timeOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
  • INP sections: ORIFICES, XSECTIONS
  • Reference checks: from_node -> node, to_node -> node
  • Removal dependency rules: None
  • Implementation status: Reserved; raises NotImplementedYetError
  • Example: m.add.link.orifice("ID", ...)
m.add.link.weir()

Reserve a weir-link definition.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
from_nodeRequired keywordstr ID of existing node objectNoneMust reference an existing node object
to_nodeRequired keywordstr ID of existing node objectNoneMust reference an existing node object
typeRequired keywordstr enumNoneValidated according to the element definition
crest_heightRequired keywordfloatNoneValidated according to the element definition
discharge_coefficientRequired keywordfloatNoneValidated according to the element definition
lengthOptional keywordfloatNoneValidated according to the element definition
side_slopeOptional keywordfloatNoneValidated according to the element definition
flap_gateOptional keywordbool or SWMM YES/NO stringNoneValidated according to the element definition
end_contractionsOptional keywordintNoneValidated according to the element definition
end_coefficientOptional keywordfloatNoneValidated according to the element definition
surchargeOptional keywordbool or SWMM YES/NO stringNoneValidated according to the element definition
road_widthOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
road_surfaceOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
  • INP sections: WEIRS
  • Reference checks: from_node -> node, to_node -> node
  • Removal dependency rules: None
  • Implementation status: Reserved; raises NotImplementedYetError
  • Example: m.add.link.weir("ID", ...)
m.add.link.outlet()

Reserve an outlet-link definition.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
from_nodeRequired keywordstr ID of existing node objectNoneMust reference an existing node object
to_nodeRequired keywordstr ID of existing node objectNoneMust reference an existing node object
rating_typeRequired keywordstr enumNoneValidated according to the element definition
curveOptional keywordstr ID of existing curve objectNoneMust reference an existing curve object
coefficientOptional keywordfloatNoneValidated according to the element definition
exponentOptional keywordfloatNoneValidated according to the element definition
offsetOptional keywordfloatNoneValidated according to the element definition
flap_gateOptional keywordbool or SWMM YES/NO stringNoneValidated according to the element definition
  • INP sections: OUTLETS
  • Reference checks: from_node -> node, to_node -> node, curve -> curve
  • Removal dependency rules: None
  • Implementation status: Reserved; raises NotImplementedYetError
  • Example: m.add.link.outlet("ID", ...)

Hydraulics

hydraulic

Add functionStatusRequired inputsOptional inputsCoordinate ruleOutputConditions
m.add.hydraulic.street(...)Reserved; raises NotImplementedYetErroridcrown_width, curb_height, cross_slope, roughness, depression_storage, gutter_width, gutter_slopeNonecreated object ID (str)Use the listed required inputs; unsupported reserved endpoints raise a clear error.
m.add.hydraulic.inlet(...)Reserved; raises NotImplementedYetErroridtype, grate_length, grate_width, grate_type, curb_length, curb_height, slotted_length, slotted_widthNonecreated object ID (str)Use the listed required inputs; unsupported reserved endpoints raise a clear error.
m.add.hydraulic.transect(...)Reserved; raises NotImplementedYetErroridroughness_left, roughness_right, roughness_channel, left_bank, right_bank, stations, elevations, modifiersNonecreated object ID (str)Use the listed required inputs; unsupported reserved endpoints raise a clear error.
m.add.hydraulic.control(...)Reserved; raises NotImplementedYetErroridtext, conditions, actions, priorityNonecreated object ID (str)Use the listed required inputs; unsupported reserved endpoints raise a clear error.
m.add.hydraulic.street()

Reserve a street definition.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
crown_widthOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
curb_heightOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
cross_slopeOptional keywordfloatNoneValidated according to the element definition
roughnessOptional keywordfloatNoneValidated according to the element definition
depression_storageOptional keywordfloatNoneValidated according to the element definition
gutter_widthOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
gutter_slopeOptional keywordfloatNoneValidated according to the element definition
  • INP sections: STREETS
  • Reference checks: None
  • Removal dependency rules: None
  • Implementation status: Reserved; raises NotImplementedYetError
  • Example: m.add.hydraulic.street("ID", ...)
m.add.hydraulic.inlet()

Reserve an inlet definition.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
typeOptional keywordstr enumNoneValidated according to the element definition
grate_lengthOptional keywordfloatNoneValidated according to the element definition
grate_widthOptional keywordfloatNoneValidated according to the element definition
grate_typeOptional keywordfloatNoneValidated according to the element definition
curb_lengthOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
curb_heightOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
slotted_lengthOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
slotted_widthOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
  • INP sections: INLETS
  • Reference checks: None
  • Removal dependency rules: None
  • Implementation status: Reserved; raises NotImplementedYetError
  • Example: m.add.hydraulic.inlet("ID", ...)
m.add.hydraulic.transect()

Reserve a transect definition.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
roughness_leftOptional keywordfloatNoneValidated according to the element definition
roughness_rightOptional keywordfloatNoneValidated according to the element definition
roughness_channelOptional keywordfloatNoneValidated according to the element definition
left_bankOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
right_bankOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
stationsOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
elevationsOptional keywordfloatNoneValidated according to the element definition
modifiersOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
  • INP sections: TRANSECTS
  • Reference checks: None
  • Removal dependency rules: None
  • Implementation status: Reserved; raises NotImplementedYetError
  • Example: m.add.hydraulic.transect("ID", ...)
m.add.hydraulic.control()

Reserve a control-rule definition.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
textOptional positionalstrNoneValidated according to the element definition
conditionsOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
actionsOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
priorityOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
  • INP sections: CONTROLS
  • Reference checks: None
  • Removal dependency rules: None
  • Implementation status: Reserved; raises NotImplementedYetError
  • Example: m.add.hydraulic.control("ID", ...)

Water quality

quality

Add functionStatusRequired inputsOptional inputsCoordinate ruleOutputConditions
m.add.quality.pollutant(...)Reserved; raises NotImplementedYetErroridunits, rain_concentration, groundwater_concentration, rdii_concentration, decay_coefficient, snow_only, co_pollutant, co_pollutant_fraction, dry_weather_flow_concentration, initial_concentrationNonecreated object ID (str)Use the listed required inputs; unsupported reserved endpoints raise a clear error.
m.add.quality.land_use(...)Reserved; raises NotImplementedYetErroridsweeping_interval, sweeping_availability, last_sweptNonecreated object ID (str)Use the listed required inputs; unsupported reserved endpoints raise a clear error.
m.add.quality.pollutant()

Reserve a pollutant definition.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
unitsOptional keywordstrNoneValidated according to the element definition
rain_concentrationOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
groundwater_concentrationOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
rdii_concentrationOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
decay_coefficientOptional keywordfloatNoneValidated according to the element definition
snow_onlyOptional keywordbool or SWMM YES/NO stringNoneValidated according to the element definition
co_pollutantOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
co_pollutant_fractionOptional keywordfloatNoneValidated according to the element definition
dry_weather_flow_concentrationOptional keywordfloatNoneValidated according to the element definition
initial_concentrationOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
  • INP sections: POLLUTANTS
  • Reference checks: None
  • Removal dependency rules: None
  • Implementation status: Reserved; raises NotImplementedYetError
  • Example: m.add.quality.pollutant("ID", ...)
m.add.quality.land_use()

Reserve a land-use definition.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
sweeping_intervalOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
sweeping_availabilityOptional keywordfloatNoneValidated according to the element definition
last_sweptOptional keywordfloatNoneValidated according to the element definition
  • INP sections: LANDUSES
  • Reference checks: None
  • Removal dependency rules: None
  • Implementation status: Reserved; raises NotImplementedYetError
  • Example: m.add.quality.land_use("ID", ...)

Curves

curve

Add functionStatusRequired inputsOptional inputsCoordinate ruleOutputConditions
m.add.curve.control(...)Implementedid, pointsNoneNonecreated object ID (str)Use the listed required inputs; unsupported reserved endpoints raise a clear error.
m.add.curve.diversion(...)Implementedid, pointsNoneNonecreated object ID (str)Use the listed required inputs; unsupported reserved endpoints raise a clear error.
m.add.curve.pump(...)Implementedid, pointscurve_typeNonecreated object ID (str)Use the listed required inputs; unsupported reserved endpoints raise a clear error.
m.add.curve.rating(...)Implementedid, pointsNoneNonecreated object ID (str)Use the listed required inputs; unsupported reserved endpoints raise a clear error.
m.add.curve.shape(...)Implementedid, pointsNoneNonecreated object ID (str)Use the listed required inputs; unsupported reserved endpoints raise a clear error.
m.add.curve.storage(...)Implementedid, pointsNoneNonecreated object ID (str)Use the listed required inputs; unsupported reserved endpoints raise a clear error.
m.add.curve.tidal(...)Implementedid, pointsNoneNonecreated object ID (str)Use the listed required inputs; unsupported reserved endpoints raise a clear error.
m.add.curve.weir(...)Implementedid, pointsNoneNonecreated object ID (str)Use the listed required inputs; unsupported reserved endpoints raise a clear error.
m.add.curve.generic(...)Implementedid, type, pointsNoneNonecreated object ID (str)Requires explicit curve type plus x/y points.
m.add.curve.control()

Add a control curve.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
pointsRequired positionallist[tuple[float, float]], pandas DataFrame, or NumPy (n, 2) arrayNoneValidated according to the element definition
  • INP sections: CURVES
  • Reference checks: None
  • Removal dependency rules: None
  • Implementation status: Implemented
  • Example: m.add.curve.control("ID", ...)
m.add.curve.diversion()

Add a diversion curve.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
pointsRequired positionallist[tuple[float, float]], pandas DataFrame, or NumPy (n, 2) arrayNoneValidated according to the element definition
  • INP sections: CURVES
  • Reference checks: None
  • Removal dependency rules: None
  • Implementation status: Implemented
  • Example: m.add.curve.diversion("ID", ...)
m.add.curve.pump()

Add a pump curve from x/y points.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
pointsRequired positionallist[tuple[float, float]], pandas DataFrame, or NumPy (n, 2) arrayNoneValidated according to the element definition
curve_typeOptional keywordstr enum'PUMP1'Validated according to the element definition
  • INP sections: CURVES
  • Reference checks: None
  • Removal dependency rules: None
  • Implementation status: Implemented
  • Example: m.add.curve.pump("PumpCurve1", [(0.0, 0.0), (1.0, 2.0)])
m.add.curve.rating()

Add a rating curve.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
pointsRequired positionallist[tuple[float, float]], pandas DataFrame, or NumPy (n, 2) arrayNoneValidated according to the element definition
  • INP sections: CURVES
  • Reference checks: None
  • Removal dependency rules: None
  • Implementation status: Implemented
  • Example: m.add.curve.rating("ID", ...)
m.add.curve.shape()

Add a shape curve.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
pointsRequired positionallist[tuple[float, float]], pandas DataFrame, or NumPy (n, 2) arrayNoneValidated according to the element definition
  • INP sections: CURVES
  • Reference checks: None
  • Removal dependency rules: None
  • Implementation status: Implemented
  • Example: m.add.curve.shape("ID", ...)
m.add.curve.storage()

Add a storage curve.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
pointsRequired positionallist[tuple[float, float]], pandas DataFrame, or NumPy (n, 2) arrayNoneValidated according to the element definition
  • INP sections: CURVES
  • Reference checks: None
  • Removal dependency rules: None
  • Implementation status: Implemented
  • Example: m.add.curve.storage("ID", ...)
m.add.curve.tidal()

Add a tidal curve.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
pointsRequired positionallist[tuple[float, float]], pandas DataFrame, or NumPy (n, 2) arrayNoneValidated according to the element definition
  • INP sections: CURVES
  • Reference checks: None
  • Removal dependency rules: None
  • Implementation status: Implemented
  • Example: m.add.curve.tidal("ID", ...)
m.add.curve.weir()

Add a weir curve.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
pointsRequired positionallist[tuple[float, float]], pandas DataFrame, or NumPy (n, 2) arrayNoneValidated according to the element definition
  • INP sections: CURVES
  • Reference checks: None
  • Removal dependency rules: None
  • Implementation status: Implemented
  • Example: m.add.curve.weir("ID", ...)
m.add.curve.generic()

Add a generic explicitly-typed curve.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
typeRequired positionalstr enumNoneExplicit SWMM curve type
pointsRequired positionallist[tuple[float, float]], pandas DataFrame, or NumPy (n, 2) arrayNoneValidated according to the element definition
  • INP sections: CURVES
  • Reference checks: None
  • Removal dependency rules: None
  • Implementation status: Implemented
  • Example: m.add.curve.generic("ID", ...)

Time data

time

Add functionStatusRequired inputsOptional inputsCoordinate ruleOutputConditions
m.add.time.time_series(...)Implementediddata, datetime, values, filename, descriptionNonecreated object ID (str)Accepts inline time/value data or filename-based series metadata.
m.add.time.time_pattern(...)Implementedid, type, multipliersNoneNonecreated object ID (str)Pattern type must be MONTHLY, DAILY, HOURLY, or WEEKEND.
m.add.time.time_series()

Add a time series from timestamp/value data or a source file.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
dataOptional positionaltime/value pairs, pandas Series/DataFrame, or compatible array-like dataNoneValidated according to the element definition
datetimeOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
valuesOptional keywordvalue compatible with the named SWMM fieldNoneValidated according to the element definition
filenameOptional keywordstrNoneValidated according to the element definition
descriptionOptional keywordstrNoneValidated according to the element definition
  • INP sections: TIMESERIES
  • Reference checks: None
  • Removal dependency rules: None
  • Implementation status: Implemented
  • Example: m.add.time.time_series("Rain1", data=[("2026-01-01 00:00", 0.0), ("2026-01-01 00:05", 5.0)])
m.add.time.time_pattern()

Add a monthly, daily, hourly, or weekend time pattern.

InputRoleExpected typeDefaultConditions / validation
idRequired first positionalstrNoneValidated according to the element definition
typeRequired positionalstr enumNoneValidated according to the element definition
multipliersRequired positional1D numeric sequenceNoneValidated according to the element definition
  • INP sections: PATTERNS
  • Reference checks: None
  • Removal dependency rules: None
  • Implementation status: Implemented
  • Example: m.add.time.time_pattern("Pat1", "DAILY", [1.0] * 24)