libtcspc.PySink

class libtcspc.PySink[source]

Bases: ABC

Abstract base class for sinks (output handling processors) written in Python.

abstractmethod flush()[source]

Signal end of input to this sink.

Notes

Called once after the graph’s downstream output is flushed. Exceptions raised propagate out of the surrounding ExecutionContext.flush call.

Return type:

None

abstractmethod handle(event)[source]

Process one event emitted to this sink from the graph.

Parameters:

event (Any) – The event object. The event type declared on the graph’s output edge must be one that is explicitly supported for delivery to Python; graphs whose output carries an unsupported event type are rejected when the graph is compiled. Bare bucket events (BucketEvent, ConstBucketEvent) are delivered as NumPy arrays; events with fields, including bucket-carrying events such as HistogramEvent, are delivered as EventInstance values whose bucket fields read as read-only NumPy arrays.

Return type:

None

Notes

Called once per event delivered to this sink. Exceptions raised propagate out of the surrounding ExecutionContext.handle call.