Legacy SWMM 5 — Compatibility Layer#

Note

Engine: SWMM 5.x — legacy. The pages in this section document openswmm.legacy.engine and openswmm.legacy.output. For the modern, recommended OpenSWMM 6 engine see OpenSWMM 6 User Guide (refactored engine).

The openswmm.legacy namespace preserves the original EPA SWMM 5.x C solver and its binary-output reader verbatim, with thin Cython wrappers, so existing scripts that target SWMM 5 continue to run unchanged.

This is a compatibility layer, not a fork:

  • The legacy code is the same source that EPA released; we apply bug fixes only.

  • No new features — every new feature lands in openswmm.engine instead.

  • The two layers can coexist in a single Python process and both can read each other’s binary .out files.

When to use which#

Use openswmm.legacy.engine when …

Use openswmm.engine when …

You have working SWMM 5 Python code and want it to keep running unchanged.

You’re starting a new project, or you’ve decided to migrate.

You depend on a specific SWMM 5 numerical detail (e.g. a third- party validation against EPA SWMM 5 outputs).

You want bulk numpy accessors, programmatic model construction, in-place editing, or the plugin SDK.

You need the exact .rpt text formatting that SWMM 5 produces.

You want multiple independent simulations in one process (reentrant engine).

If you’re sitting on a pile of SWMM 5 Python code today, see Migrating from SWMM 5 to v6 for a side-by-side translation.

Layout#

For the API reference (every public class and method) see the Legacy section of the API page.