pipeline.port

Port primitives for the pipeline framework.

Contains the core port-related classes:

  • PortReference: typed handle to a specific module port (for IDE support)

  • ChainedConnection: batches multiple port connections with the | operator

  • _PortDataCheck: internal Pydantic model that validates port data at runtime

  • Port: a single data slot on a PipeModule (input or output)

Classes

class pipeline.port.PortReference

A reference to a specific port of a module for IDE-friendly port access.

Inherits from:

<ast.Subscript object at 0x0000028E217659F0>

Methods:

__init__(module: PipeModule, port_name: str, port_direction: Literal[input, output], expected_data_type: Type[PortDataType] | str | None = None)

Initialize PortReference.

Parameters

modulePipeModule

The module that owns this port

port_namestr

The name of the port port_direction : Literal[“input”, “output”] The direction of port (‘input’ or ‘output’)

expected_data_typeType[PortDataType] | str | None

The expected data type for this port (for IDE hints)

Properties:

data

Get the actual data from the port.

class pipeline.port.ChainedConnection

Represents a chain of port connections for batch linking.

Methods:

__init__(connections: list)

Convert chained connections to Link objects.

class pipeline.port.Port

Methods:

__init__(ptype: PortType | list[PortType] = PortType.NumberArray, data: Any = None, pdoc: str | None = None) None

Initialize the Port object.

Parameters

ptypePortType | list[PortType], default: PortType.Field

The data type of in or out of the port which can be one type or several types.

dataAny, default: None

The data in or out of the port.

pdocstr, default: None

The description of the port.

Properties:

data