TimeIntervalStamp
TimeIntervalStamp(intervals, source_id, source=None, is_interpolated=False)
A synchronized collection of canonical typed timeline intervals.
Parameters
| intervals |
dict[str, Interval] |
Timeline-ID to interval mapping. |
required |
| source_id |
str |
Timeline identity defining the interval axis. |
required |
| source |
TimeStampSource | None |
Optional object providing conversion maps. |
None |
| is_interpolated |
bool |
Whether any endpoint was estimated. |
False |
Attributes
| axis |
Return the typed interval on the source axis. |
| duration |
Return the typed duration on the source axis. |
| end |
Return a derived instant stamp of all interval ends. |
| present_timelines |
Return stored timeline IDs in deterministic insertion order. |
| start |
Return a derived instant stamp of all interval starts. |
Methods
| get_duration_for |
Return one stored interval duration with timeline identity. |
| get_interval |
Return one stored interval by timeline identity. |
| get_interval_in |
Convert both endpoints of one stored interval to a target unit. |
| get_intervals |
Return selected stored intervals in requested order. |
get_duration_for
TimeIntervalStamp.get_duration_for(timeline_id)
Return one stored interval duration with timeline identity.
Parameters
| timeline_id |
str |
Stored timeline identity. |
required |
Returns
|
IdDuration |
The canonical typed ID duration. |
get_interval
TimeIntervalStamp.get_interval(timeline_id)
Return one stored interval by timeline identity.
Parameters
| timeline_id |
str |
Stored timeline identity. |
required |
Raises
|
KeyError |
If the timeline is absent. |
get_interval_in
TimeIntervalStamp.get_interval_in(unit, *, timeline_id=None)
Convert both endpoints of one stored interval to a target unit.
Parameters
| unit |
TimeUnit |
Requested target unit. |
required |
| timeline_id |
str | None |
Optional stored axis to select explicitly. |
None |
Returns
|
Interval |
A typed interval in the target unit. |
get_intervals
TimeIntervalStamp.get_intervals(timeline_ids=None)
Return selected stored intervals in requested order.
Parameters
| timeline_ids |
KeyCollection | None |
Timeline IDs, or None for every stored interval. |
None |
Returns
|
dict[str, Interval] |
A new ordered interval dictionary. |