libtcspc.EventInstance¶
- class libtcspc.EventInstance(event_type, fields)[source]¶
Bases:
objectA concrete event value: an
EventTypeplus its field values.Unlike an
EventType(which is only a type tag), anEventInstancerepresents an actual event value with concrete field contents. Construct one viaEventType.value(), for exampleDetectionEvent(nt).value(abstime=42, channel=1).Used as the event inserted by
Prepend/Append, as input toExecutionContext.handle, and as the value delivered to aPySink. Field values are concrete ints, floats, strings, or (for bucket fields) read-only NumPy arrays; read them as attributes (for example,event.abstime).Prepend/Appendcan also insert an event value bound at run time via aParam.Instances of bucket-carrying event types (such as
HistogramEvent) are not hashable.Constructing and inspecting individual event values from Python is intended for debugging and learning only and is extremely slow; production graphs process events in compiled C++ and exchange bulk data via buckets.
See also
EventType.value()The factory used to construct an
EventInstance.