lenskit.pipeline.nodes#

Node objects used to represent pipelines internally. It is very rare for client code to need to work with the types in this module.

Stability:

Internal

Classes#

Node

Representation of a single node in a Pipeline.

InputNode

An input node.

LiteralNode

A node storing a literal value.

ComponentNode

A node storing a component. This is an abstract node class; see subclasses

ComponentConstructorNode

A node storing a component. This is an abstract node class; see subclasses

ComponentInstanceNode

A node storing a component. This is an abstract node class; see subclasses

Module Contents#

class lenskit.pipeline.nodes.Node[T](name, *, types=None)#

Representation of a single node in a Pipeline.

Stability:
Caller (see Stability Levels).
Parameters:
__match_args__ = ('name',)#
name: str#

The name of this node.

types: set[type] | None#

The set of valid data types of this node, or None for no typechecking.

__str__()#
Return type:

str

class lenskit.pipeline.nodes.InputNode[T](name, *, types=None)#

Bases: Node[T]

An input node.

Stability:
Internal (see Stability Levels).
Parameters:
class lenskit.pipeline.nodes.LiteralNode[T](name, value, *, types=None)#

Bases: Node[T]

A node storing a literal value.

Stability:
Internal (see Stability Levels).
Parameters:
__match_args__ = ('name', 'value')#
value: T#

The value associated with this node

class lenskit.pipeline.nodes.ComponentNode[T](name)#

Bases: Node[T]

A node storing a component. This is an abstract node class; see subclasses ComponentConstructorNode and ComponentInstanceNode.

Stability:
Internal (see Stability Levels).
Parameters:

name (str)

static create[CFG](name, comp, config=None)#
Parameters:
Return type:

ComponentNode[T]

property inputs: dict[str, lenskit.pipeline.components.ComponentInput]#
Abstractmethod:

Return type:

dict[str, lenskit.pipeline.components.ComponentInput]

class lenskit.pipeline.nodes.ComponentConstructorNode[T](name, constructor, config)#

Bases: ComponentNode[T]

A node storing a component. This is an abstract node class; see subclasses ComponentConstructorNode and ComponentInstanceNode.

Stability:
Internal (see Stability Levels).
Parameters:
__match_args__ = ('name', 'constructor', 'config')#
constructor: lenskit.pipeline.components.ComponentConstructor[Any, T]#
config: object | None#
property inputs#
class lenskit.pipeline.nodes.ComponentInstanceNode[T](name, component)#

Bases: ComponentNode[T]

A node storing a component. This is an abstract node class; see subclasses ComponentConstructorNode and ComponentInstanceNode.

Stability:
Internal (see Stability Levels).
Parameters:
__match_args__ = ('name', 'component')#
component: lenskit.pipeline.components.Component[T] | lenskit.pipeline.components.PipelineFunction[T]#
property inputs#

Exported Aliases#

class lenskit.pipeline.nodes.Component#

Re-exported alias for lenskit.pipeline.components.Component.

class lenskit.pipeline.nodes.ComponentConstructor#

Re-exported alias for lenskit.pipeline.components.ComponentConstructor.

class lenskit.pipeline.nodes.ComponentInput#

Re-exported alias for lenskit.pipeline.components.ComponentInput.

lenskit.pipeline.nodes.PipelineFunction#

Re-exported alias for lenskit.pipeline.components.PipelineFunction.

lenskit.pipeline.nodes.component_inputs()#

Re-exported alias for lenskit.pipeline.components.component_inputs().

lenskit.pipeline.nodes.component_return_type()#

Re-exported alias for lenskit.pipeline.components.component_return_type().