INode
- class gpype.backend.core.i_node.INode[source]
Bases:
PlacingMixin,INode,NodeAbstract 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. A sink or a widget passes its
edge_idhere, and it is checked here because every one of them reaches this constructor; a node that only touches data passes none.
- Raises:
ValueError – If an edge_id is empty or padded with whitespace.
TypeError – If an edge_id is not a string.
- serialize()[source]
Serialise the node, writing an unset edge id as no key.
So a document that assigns no sink or widget to an edge is what it was before edge ids existed. See
document.omit_unassigned_edge.- Return type:
- Returns:
The serialised node.
- 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:
- Return type:
- Returns:
Dictionary mapping port names to validated context dictionaries.
- Raises:
ValueError – If required metadata keys are missing.