GroupTimestamp

timelines.GroupTimestamp(
    coordinates,
    source_id,
    row_index=-1,
    source=None,
    is_interpolated=False,
    conversion_maps=True,
)

A synchronized instant across all timelines in a group.

This is a view object created from a row in the group’s timestamp table. Not stored directly - the table is the source of truth.

Attributes

Name Type Description
coordinates dict[str, Coordinate] Dictionary mapping timeline IDs to canonical coordinates. Null table cells are omitted.
row_index int Index of this timestamp in the source table. -1 indicates an interpolated timestamp (not from a table row).

Examples

>>> ts = group.get_timestamp_at_index(0)
>>> ts.get_coordinate_for("dgt1:1", format="float")
0.0
>>> ts.present_timelines  # Which timelines have values here
['dgt1:1', 'audio:1']

See Also

TimeStamp: The unified timestamp class from timetoalign.core.

Methods

Name Description
get_conversion_for Return a conversion-map value by selector.
get_unit Get the row coordinate converted to a specific unit.

get_conversion_for

timelines.GroupTimestamp.get_conversion_for(key)

Return a conversion-map value by selector.

Parameters

Name Type Description Default
key str Conversion-map name, ID, selector, or target-unit name. required

Returns

Name Type Description
object The map result without numeric projection.

Raises

Name Type Description
KeyError If no eligible conversion matches.

get_unit

timelines.GroupTimestamp.get_unit(
    unit,
    *,
    timeline_id=None,
    format='id_coordinate',
    rounding='round',
)

Get the row coordinate converted to a specific unit.

Parameters

Name Type Description Default
unit TimeUnit The target unit for conversion. required
timeline_id str | None Optional stored member to select explicitly. None
format CoordinateFormat Requested coordinate output format. 'id_coordinate'
rounding Rounding Integral projection mode. 'round'

Returns

Name Type Description
CoordinateResult | pd.Series Converted coordinate projection.

Raises

Name Type Description
KeyError If no selected coordinate or eligible map exists.