SegmentLine

timelines.SegmentLine(**kwargs)

A timeline whose cached parameterized classes inherit the segment API.

Methods

Name Description
from_segmentation Create a parameterized line from slices of an unchanged source.

from_segmentation

timelines.SegmentLine.from_segmentation(source, split_coords, copy_events=True)

Create a parameterized line from slices of an unchanged source.

Parameters

Name Type Description Default
source Timeline Timeline to segment (not modified). required
split_coords list[CoordinateSpec] Coordinates defining segment boundaries. k+1 coordinates create k segments. required
copy_events bool If True, copy events to their respective segments. True

Returns

Name Type Description
'SegmentLine' New SegmentLine with segments typed to match source.

Raises

Name Type Description
ValueError If source already has children (ambiguous nesting).
ValueError If fewer than 2 split coordinates provided.
TypeError If a parameterized receiver does not match the source.