IChain
- class ioiocore.i_chain.IChain(input_ports=None, **kwargs)[source]
Bases:
ChainA chain that receives input and processes it through a sequence of internal nodes.
Structure: <input> => IONode => … => IONode => INode
The input ports are exposed from the first internal node, making this chain usable anywhere an input element is expected.
Inheriting classes must implement
create_internal_nodes(), which returns the list of internal nodes.Example
class MyProcessor(IChain): def create_internal_nodes(self) -> List[Node]: return [ FilterNode(), # IONode TransformNode(), # IONode SinkNode() # INode (terminal) ]
- Parameters:
input_ports (list)
- class Configuration(input_ports=None, **kwargs)[source]
Bases:
ConfigurationConfiguration class for IChain.
- Parameters:
input_ports (list)
- __init__(input_ports=None, **kwargs)[source]
Initialize the IChain.
- Parameters:
input_ports (
list) – A list of input port configurations (default is None).**kwargs (additional keyword arguments) – Other configuration options.
- config: Configuration
- abstractmethod create_internal_nodes()[source]
Create and return the list of internal nodes.
The first node must have input ports (IONode or INode). The last node must be an INode. Intermediate nodes should be IONodes.
- Returns:
List of internal nodes forming the processing chain.
- Return type:
List[Node]
- get_port(port_name)[source]
Deprecated: use
get_input_port()instead.- Parameters:
port_name (str)