lenskit.pipeline.components#

Definition of the component interfaces.

Attributes#

PipelineFunction

Pure-function interface for pipeline functions.

Classes#

ComponentInput

Representation of a component input slot.

ComponentConstructor

Protocol for component constructors.

Component

Base class for pipeline component objects. Any component that is not just a

PlaceholderConfig

Configuration for the placeholder component.

Placeholder

Simple no-op component to use as a placeholder in partial pipelines.

Functions#

component_inputs(component, *[, warn_on_missing, ...])

component_return_type(component)

fallback_on_none(primary, fallback)

Fallback to a second component if the primary input is None.

is_component_class(obj)

Check if the provided object is a component class.

Module Contents#

type lenskit.pipeline.components.PipelineFunction = Callable[..., COut]#

Pure-function interface for pipeline functions.

lenskit.pipeline.components.component_inputs[COut](component, *, warn_on_missing=True, _warn_level=1)#
Parameters:
Return type:

dict[str, ComponentInput]

lenskit.pipeline.components.component_return_type[COut](component)#
Parameters:

component (Component[COut] | ComponentConstructor[Any, COut] | PipelineFunction[COut])

Return type:

type[COut] | None

lenskit.pipeline.components.fallback_on_none[T](primary, fallback)#

Fallback to a second component if the primary input is None.

Stability:
Caller (see Stability Levels).
Parameters:
Return type:

T

lenskit.pipeline.components.is_component_class(obj)#

Check if the provided object is a component class.

Parameters:

obj (Any)

Return type:

bool

Exported Aliases#

exception lenskit.pipeline.components.PipelineWarning#

Re-exported alias for lenskit.diagnostics.PipelineWarning.

class lenskit.pipeline.components.Lazy#

Re-exported alias for lenskit.lazy.Lazy.

exception lenskit.pipeline.components.TypecheckWarning#

Re-exported alias for lenskit.pipeline._types.TypecheckWarning.

lenskit.pipeline.components.is_compatible_data()#

Re-exported alias for lenskit.pipeline._types.is_compatible_data().