Pipeline

class gpype.backend.pipeline.Pipeline[source]

Bases: Pipeline

Brain-Computer Interface pipeline for real-time data processing.

Extends ioiocore Pipeline for BCI applications with automatic logging to platform-specific directories. Manages node lifecycle, data flow connections, and real-time execution of interconnected processing nodes.

__init__()[source]

Initialize Pipeline with platform-specific logging directory.

connect(source, target)[source]

Connect two nodes to establish data flow in the pipeline. Nodes are automatically added to pipeline if not already present.

Parameters:
  • source (Union[Node, dict]) – Source node or port specification. Use dict for specific ports (e.g., node[“port_name”]).

  • target (Union[Node, dict]) – Target node or port specification. Use dict for specific ports (e.g., node[“port_name”]).

start()[source]

Start the pipeline and begin real-time data processing.

Initiates execution of all nodes according to their configured connections and timing. Runs continuously until stop() is called. This method is non-blocking.

stop()[source]

Stop the pipeline and terminate all data processing.

Gracefully shuts down all nodes and cleans up resources including threads, file handles, and hardware connections. Always call stop() before program termination to ensure proper cleanup, especially when using hardware interfaces.

serialize()[source]

Serialize the pipeline configuration to a dictionary.

Returns:

Dictionary containing the complete pipeline configuration,

including nodes, connections, parameters, and metadata.

Return type:

dict

static deserialize(data)[source]

Deserialize a pipeline configuration from a dictionary.

Parameters:

data (dict) – Serialized pipeline configuration dictionary.

Returns:

A new Pipeline instance with the specified configuration.

Return type:

Pipeline