MatchStamp
alignment.MatchStamp(
coordinates= dict (),
source_id= '' ,
anchor_edges= list (),
inferred_edges= list (),
source= None ,
is_interpolated= False ,
conversion_maps= False ,
)
A synchronized timestamp across multiple timelines.
A MatchStamp represents a single coordinate (or instant) that has been synchronized across multiple timelines via explicit anchors and/or inferred group membership.
Contains one coordinate per participating timeline, where coordinates are linked via explicit anchors or inferred group membership.
Attributes
coordinates
dict[str, Coordinate ]
Dictionary of timeline ID to canonical coordinate.
anchor_edges
list[tuple[str, str]]
List of (tl_a, tl_b) pairs that are explicitly anchored.
inferred_edges
list[tuple[str, str]]
List of (tl_a, tl_b) pairs inferred via groups.
axis
IdCoordinate
Identified source coordinate derived from storage.
source
'AlignmentBundle | None'
Bundle that produced the stamp.
source_id
str
Timeline ID used for the query.
is_interpolated
bool
Whether the stamp used interpolated transfer.
conversion_maps
ConversionMapsSpec
Conversion maps available to unit lookup and display. Opt-in: defaults to False.
Examples
>>> stamp = MatchStamp(
... coordinates= {
... "score" : Coordinate(100.0 , TimeUnit.quarters),
... "audio" : Coordinate(45.5 , TimeUnit.seconds),
... },
... source_id= "score" ,
... anchor_edges= [("score" , "audio" )],
... )
>>> stamp.get_coordinate_for("audio" , format = "float" )
45.5
Methods
filter_by_timelines
Create filtered stamp with subset of timelines.
from_dict
Deserialize a graph-shaped typed wire dictionary.
get_conversion_for
Return an enabled conversion-map value by selector.
get_unit
Get the query coordinate converted to a unit.
has_timeline
Check if timeline is in this stamp.
to_dict
Materialize the stamp in a flat, grouped, or graph representation.
filter_by_timelines
alignment.MatchStamp.filter_by_timelines(timeline_ids= None , id_pattern= None )
Create filtered stamp with subset of timelines.
Parameters
timeline_ids
set[str] | None
Only include these timelines (None = all).
None
id_pattern
str | None
Regex filter for timeline IDs.
None
Returns
'MatchStamp'
New MatchStamp with filtered timelines.
from_dict
alignment.MatchStamp.from_dict(data)
Deserialize a graph-shaped typed wire dictionary.
Parameters
data
dict[str, Any]
Graph-shaped stamp payload.
required
Returns
'MatchStamp'
A canonical typed match stamp.
get_conversion_for
alignment.MatchStamp.get_conversion_for(key)
Return an enabled conversion-map value by selector.
Parameters
key
str
Map name, ID, selector, or target-unit name.
required
Returns
object
The map result without numeric projection.
Raises
KeyError
If no eligible conversion matches.
get_unit
alignment.MatchStamp.get_unit(
unit,
* ,
timeline_id= None ,
format = 'id_coordinate' ,
rounding= 'round' ,
)
Get the query coordinate converted to a unit.
Unit conversion is delegated to the source timeline’s owning group so the same conversion-map selection rules as TimeStamp apply.
Parameters
unit
TimeUnit
The target unit.
required
timeline_id
str | None
Optional stored axis to select explicitly.
None
format
CoordinateFormat
Requested coordinate output format.
'id_coordinate'
rounding
Rounding
Integral projection mode.
'round'
Returns
CoordinateResult | pd.Series
The converted coordinate projection.
has_timeline
alignment.MatchStamp.has_timeline(timeline_id)
Check if timeline is in this stamp.
to_dict
alignment.MatchStamp.to_dict(format = 'flat' )
Materialize the stamp in a flat, grouped, or graph representation.
Parameters
format
Literal['flat', 'prefix', 'nested', 'graph']
Output representation. "graph" preserves the MatchGraph storage shape.
'flat'
Returns
dict[str, Any]
The requested dictionary representation.
Raises
ValueError
If a grouped format is requested without a source bundle, or if the format is unknown.