swmmx Documentation

Creating Models

The constructor opens an existing model or creates a new SI/US model. Do not combine path with new or flow_unit, because existing INP files already define their own unit settings.

from swmmx import swmm

m = swmm("examples/example.inp")         # open an existing model
m = swmm()                               # new SI model, LPS by default
m = swmm(new="SI", flow_unit="CMS")      # new SI model
m = swmm(new="US", flow_unit="GPM")      # new US model
m = swmm("model.inp", custom_dll_path="C:/engines/swmm5.dll")

Arguments

ArgumentDescription
pathOptional path to an existing .inp file.
new"SI" or "US" for an empty model. If omitted with no path, SI is used.
flow_unitFor new models only. SI accepts LPS, CMS, MLD; US accepts CFS, GPM, MGD.
custom_dll_pathOptional native SWMM engine library path used when running simulations.