lenskit.pipeline.config#
Pydantic models for pipeline configuration and serialization support.
Functions
|
Compute the hash of a configuration model. |
Classes
|
Specification of a pipeline component. |
|
Root type for serialized pipeline configuration. |
|
A single entry in a pipeline's hook configuration. |
|
Hook specifications for a pipeline. |
|
Spcification of a pipeline input. |
|
Literal nodes represented in the pipeline. |
|
Pipeline metadata. |
|
Options used for pipeline assembly, particularly for extending pipelines. |
- class lenskit.pipeline.config.PipelineHook(*, function, priority=1)#
Bases:
BaseModelA single entry in a pipeline’s hook configuration.
- Parameters:
- model_config = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class lenskit.pipeline.config.PipelineHooks(*, run={})#
Bases:
BaseModelHook specifications for a pipeline.
- Parameters:
run (dict[str, list[PipelineHook]])
- model_config = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class lenskit.pipeline.config.PipelineOptions(*, base=None, default_length=None, fallback_predictor=None, **extra_data)#
Bases:
BaseModelOptions used for pipeline assembly, particularly for extending pipelines.
- Parameters:
- fallback_predictor: bool | None#
For rating prediction pipelines, enable or disable the default fallback predictor.
- model_config = {'extra': 'allow'}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class lenskit.pipeline.config.PipelineConfig(**data)#
Bases:
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).
- Parameters:
data (Any)
options (PipelineOptions | None)
meta (PipelineMeta)
inputs (list[PipelineInput])
components (OrderedDict[str, PipelineComponent])
default (str | None)
literals (dict[str, PipelineLiteral])
hooks (PipelineHooks)
- options: PipelineOptions | None#
Options for assembling the final pipeline.
- meta: PipelineMeta#
Pipeline metadata.
- inputs: list[PipelineInput]#
Pipeline inputs.
- components: 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:
- model_config = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class lenskit.pipeline.config.PipelineMeta(*, name=None, version=None, hash=None)#
Bases:
BaseModelPipeline metadata.
- Stability:
- Full (see Stability Levels).
- Parameters:
- hash: str | None#
The pipeline configuration hash. This is optional, particularly when hand-crafting pipeline configuration files.
- model_config = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class lenskit.pipeline.config.PipelineInput(*, name, types)#
Bases:
BaseModelSpcification of a pipeline input.
- Stability:
- Full (see Stability Levels).
- Parameters:
- model_config = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class lenskit.pipeline.config.PipelineComponent(*, code, config=None, inputs={})#
Bases:
BaseModelSpecification of a pipeline component.
- model_config = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- 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.
- class lenskit.pipeline.config.PipelineLiteral(*, encoding, value)#
Bases:
BaseModelLiteral nodes represented in the pipeline.
- Stability:
- Full (see Stability Levels).
- Parameters:
encoding (Literal['json', 'base85'])
value (JsonValue)
- model_config = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- lenskit.pipeline.config.hash_config(config)#
Compute the hash of a configuration model.
- Stability:
- Internal (see Stability Levels).
- Parameters:
config (BaseModel)
- Return type: