Skip to content

Time series

Look up a TimeSeries in simulation.time_series by configured ID or position, then pass it to a setting that accepts a time-series relationship. The view is read-only and belongs to the current project generation. It represents the configured definition.

from swmmrs import Simulation
from swmmrs.objects import Outfall, OutfallBoundary

with Simulation("model.inp", "model.rpt") as simulation:
    series = simulation.time_series["OUTFALL-STAGE"]
    print(series.id, series.index)
    assert simulation.time_series.by_index(series.index) == series

    outfall = simulation.nodes["OUT-1"]
    if isinstance(outfall, Outfall):
        outfall.settings.boundary = OutfallBoundary(
            "timeseries",
            reference=series,
        )

Typed, generation-bound views over configured SWMM project objects.

All view instances retain the simulation and project generation that created them. They validate that identity before accessing native state, so retained views cannot silently address a subsequently reopened project.

CLASS DESCRIPTION
TimeSeries

Expose a generation-bound time-series definition.

TimeSeries


              flowchart TD
              swmmrs.objects.TimeSeries[TimeSeries]
              swmmrs.objects._base._LiveView[_LiveView]

                              swmmrs.objects._base._LiveView --> swmmrs.objects.TimeSeries
                


              click swmmrs.objects.TimeSeries href "" "swmmrs.objects.TimeSeries"
              click swmmrs.objects._base._LiveView href "" "swmmrs.objects._base._LiveView"
            

Expose a generation-bound time-series definition.