timeflux.nodes.gate


Gate node that resume or stop the streaming data

gate

class timeflux.nodes.gate.Gate(event_opens, event_closes, event_label='label', truncate=False)[source]

Bases: timeflux.core.node.Node

Data-gate based on event triggers.

This node cuts off or puts through data depending on event triggers It has 3 operating mode/status: - silent: the node waits for an opening trigger in the events and returns nothing - opened: the node waits for a closing trigger in the events and free pass the data - closed: the node has just received a closing trigger, so free pass the data and resets its state.

It continuously iterates over events data to update its operating mode.

Variables:
  • i (Port) – Default data input, expects DataFrame or or XArray.

  • i_events (Port) – Event input, expects DataFrame.

  • o (Port) – Default output, provides DataFrame or XArray and meta.

Parameters:
  • event_opens (string) – The marker name on which the gate open.s

  • event_closes (string) – The marker name on which the the gate closes.

  • event_label (string) – The column to match for event_trigger.

Todo: allow for multiple input ports.

Instantiate the node.

update()[source]

Update the input and output ports.