INode

class gpype.backend.core.i_node.INode[source]

Bases: INode, Node

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

Combines ioiocore.INode and Node functionality for nodes that consume input data without producing outputs (e.g., file writers, displays). Subclasses must implement the abstract step() method.

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

Initialize the INode with input port configurations.

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

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

setup(data, port_context_in)[source]

Setup the input node before pipeline processing begins.

Validates that all input ports have required metadata keys (frame_size, channel_count) then delegates to parent setup.

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

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

Return type:

dict[str, dict]

Returns:

Dictionary mapping port names to validated context dictionaries.

Raises:

ValueError – If required metadata keys are missing.

abstractmethod step(data)[source]

Process input data at each pipeline time step.

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

Parameters:

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

Return type:

dict[str, ndarray]

Returns:

Dictionary mapping output port names to numpy arrays. Typically None or empty dict for input-only nodes.