lenskit.pipeline.config#
Pydantic models for pipeline configuration and serialization support.
Attributes#
Classes#
A single entry in a pipeline's hook configuration. |
|
Hook specifications for a pipeline. |
|
Options used for pipeline assembly, particularly for extending pipelines. |
|
Root type for serialized pipeline configuration. A pipeline config contains |
|
Pipeline metadata. |
|
Spcification of a pipeline input. |
|
Specification of a pipeline component. |
|
Literal nodes represented in the pipeline. |
Functions#
|
Check that a name is valid. |
|
Compute the hash of a configuration model. |
Module Contents#
- lenskit.pipeline.config.VALID_NAME#
- lenskit.pipeline.config.check_name(name, *, what='node', allow_reserved=False)#
Check that a name is valid.
- Raises:
ValueError – If the specified name is not valid.
- Parameters:
- class lenskit.pipeline.config.PipelineHook#
Bases:
pydantic.BaseModelA single entry in a pipeline’s hook configuration.
- priority: Annotated[int, Predicate(lambda x: x != 0)] = 1#
- classmethod from_entry(hook)#
- Parameters:
hook (lenskit.pipeline._hooks.HookEntry[Any])
- class lenskit.pipeline.config.PipelineHooks#
Bases:
pydantic.BaseModelHook specifications for a pipeline.
- run: dict[str, list[PipelineHook]]#
- class lenskit.pipeline.config.PipelineOptions#
Bases:
pydantic.BaseModelOptions used for pipeline assembly, particularly for extending pipelines.
- class lenskit.pipeline.config.PipelineConfig#
Bases:
pydantic.BaseModelRoot type for serialized pipeline configuration. A pipeline config contains the full configuration, components, and wiring for the pipeline, but does not contain the learned parameters.
- Stability:
- Full (see Stability Levels).
- options: PipelineOptions | None = None#
Options for assembling the final pipeline.
- meta: PipelineMeta#
Pipeline metadata.
- inputs: list[PipelineInput] = []#
Pipeline inputs.
- components: collections.OrderedDict[str, PipelineComponent]#
Pipeline components, with their configurations and wiring.
- literals: dict[str, PipelineLiteral]#
Literals
- hooks: PipelineHooks#
The hooks configured for the pipeline.
- merge_component_configs(configs)#
Merge component configuration options into the pipeline configuration.
This returns a modified copy of the pipeline with the applied configurations, and does not modify the configuration in-place.
- Parameters:
- Return type:
- class lenskit.pipeline.config.PipelineMeta#
Bases:
pydantic.BaseModelPipeline metadata.
- Stability:
- Full (see Stability Levels).
- class lenskit.pipeline.config.PipelineInput#
Bases:
pydantic.BaseModelSpcification of a pipeline input.
- Stability:
- Full (see Stability Levels).
- classmethod from_node(node)#
- Parameters:
node (lenskit.pipeline.nodes.InputNode[Any])
- Return type:
Self
- class lenskit.pipeline.config.PipelineComponent#
Bases:
pydantic.BaseModelSpecification of a pipeline component.
- code: str#
The path to the component’s implementation, either a class or a function. This is a Python qualified path of the form
module:name.
- config: Mapping[str, pydantic.JsonValue] | None = None#
The component configuration. If not provided, the component will be created with its default constructor parameters.
- inputs: dict[str, str]#
The component’s input wirings, mapping input names to node names. For certain meta-nodes, it is specified as a list instead of a dict.
- classmethod from_node(node)#
- Parameters:
node (lenskit.pipeline.nodes.ComponentNode[Any])
- Return type:
Self
- class lenskit.pipeline.config.PipelineLiteral#
Bases:
pydantic.BaseModelLiteral nodes represented in the pipeline.
- Stability:
- Full (see Stability Levels).
- encoding: Literal['json', 'base85']#
- value: pydantic.JsonValue#
- classmethod represent(data)#
- Parameters:
data (Any)
- Return type:
Self
- decode()#
Decode the represented literal.
- Return type:
Any
- lenskit.pipeline.config.hash_config(config)#
Compute the hash of a configuration model.
- Stability:
- Internal (see Stability Levels).
- Parameters:
config (pydantic.BaseModel)
- Return type:
Exported Aliases#
- exception lenskit.pipeline.config.PipelineError#
Re-exported alias for
lenskit.diagnostics.PipelineError.
- exception lenskit.pipeline.config.PipelineWarning#
Re-exported alias for
lenskit.diagnostics.PipelineWarning.
- class lenskit.pipeline.config.HookEntry#
Re-exported alias for
lenskit.pipeline._hooks.HookEntry.
- lenskit.pipeline.config.make_importable_path()#
Re-exported alias for
lenskit.pipeline._types.make_importable_path().
- class lenskit.pipeline.config.Component#
Re-exported alias for
lenskit.pipeline.components.Component.
- class lenskit.pipeline.config.ComponentConstructorNode#
Re-exported alias for
lenskit.pipeline.nodes.ComponentConstructorNode.
- class lenskit.pipeline.config.ComponentInstanceNode#
Re-exported alias for
lenskit.pipeline.nodes.ComponentInstanceNode.
- class lenskit.pipeline.config.ComponentNode#
Re-exported alias for
lenskit.pipeline.nodes.ComponentNode.
- class lenskit.pipeline.config.InputNode#
Re-exported alias for
lenskit.pipeline.nodes.InputNode.