Marker
- class gpype.backend.sources.marker.Marker[source]
Bases:
EventSourceMarks events from the code that produced them.
The stimulus is presented by the application, so the application is what knows when it happened. This is the sanctioned way to say so:
marker = gp.Marker(codes={“target”: 1, “nontarget”: 2}) … marker.emit(“target”)
The event is timestamped on the calling thread at the moment it is emitted, and placed onto the master timeline from that observation. Nothing is buffered or delayed, because a delay would move the event away from when it actually happened.
- __init__(codes=None, channel_count=1, edge_id=None, **kwargs)[source]
Initialize the marker.
- Parameters:
codes (
Optional[dict]) – Optional name to numeric code map, so a paradigm can mark events by name instead of by magic number.channel_count (
int) – Number of marker channels.edge_id (
Optional[str]) – Which edge runs this node, matched against the edge process’s –edge-id. None, the default, is every edge; ignored when the pipeline is not distributed.**kwargs – Additional arguments for the parent EventSource.
- emit(value)[source]
Emit one marker.
- Parameters:
value (
Union[int,float,str]) – A numeric code, or a name declared incodes.- Raises:
RuntimeError – Under server residency, where markers do not originate – the stimulus is presented on the edge – and on an edge this Marker is not assigned to.
KeyError – If a name was given that is not in
codes.
- Return type: