ONode

class gpype.backend.core.o_node.ONode[source]

Bases: ONode, Node

Abstract base class for output-only nodes in the g.Pype pipeline.

Combines ioiocore.ONode and Node functionality for nodes that generate output data without consuming inputs (e.g., EEG devices, signal generators). Subclasses must implement the abstract step() method.

__init__(output_ports=None, **kwargs)[source]

Initialize the ONode with output port configurations.

Parameters:
  • output_ports (list[Configuration]) – List of output port configurations or None.

  • **kwargs – Additional arguments passed to parent classes.

setup(data, port_context_in)[source]

Setup the output node before processing begins.

Delegates to parent setup method to configure output port contexts.

Parameters:
  • data (dict[str, ndarray]) – Dictionary mapping port names to numpy arrays.

  • port_context_in (dict[str, dict]) – Dictionary mapping input port names to contexts.

Return type:

dict[str, dict]

Returns:

Dictionary mapping output port names to context dictionaries.

abstractmethod step(data)[source]

Generate output data at each discrete time step.

Abstract method that must be implemented by subclasses to define their specific data generation behavior.

Parameters:

data (dict[str, ndarray]) – Dictionary mapping input port names to numpy arrays. Typically empty for output-only nodes.

Return type:

dict[str, ndarray]

Returns:

Dictionary mapping output port names to numpy arrays containing the generated output data.