boilercv.pipelines
#
Pipelines.
Subpackages#
Submodules#
Package Contents#
Classes#
Pipeline base model. |
|
Pipeline model. |
|
Context for expression validation. |
Functions#
Set |
|
Compose contexts. |
|
Compose defaults. |
|
Compose inner contexts. |
Data#
Pipe model context key. |
API#
- boilercv.pipelines.PIPELINE#
‘pipeline’
Pipe model context key.
- class boilercv.pipelines.PipelineBase(
- /,
- **data: context_models.types.Data,
Bases:
context_models.ContextBase
Pipeline base model.
Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError
][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.self
is explicitly positional-only to allowself
as a field name.
- class boilercv.pipelines.Pipeline(
- /,
- root=PydanticUndefined,
- **data: context_models.types.V,
Bases:
boilercv.morphs.Morph
[boilercv.pipelines.types.K
,boilercv.pipelines.types.V
],typing.Generic
[boilercv.pipelines.types.K
,boilercv.pipelines.types.V
]Pipeline model.
Initialization
- classmethod morph_validate_before(
- data: dict[boilercv.pipelines.types.K, boilercv.pipelines.types.V],
- info: boilercv.pipelines.contexts.types.PipelineValidationInfo,
Validate context before.
- morph_validate_after(
- info: boilercv.pipelines.contexts.types.PipelineValidationInfo,
Validate context after.
- classmethod apply(
- mode: boilercv.pipelines.types.Mode,
- data: boilercv.pipelines.types.T,
- info: boilercv.pipelines.contexts.types.PipelineValidationInfo,
Apply a pipe to data.
- classmethod compose_defaults(
- mapping: dict[boilercv.pipelines.types.K, boilercv.pipelines.types.V | pydantic.BaseModel] | None = None,
- keys: tuple[boilercv.pipelines.types.K, ...] | None = None,
- value: boilercv.pipelines.types.V | pydantic.BaseModel | None = None,
- value_copier: collections.abc.Callable[[boilercv.pipelines.types.V | pydantic.BaseModel], boilercv.pipelines.types.V | pydantic.BaseModel] = lambda v: ...,
- factory: collections.abc.Callable[..., Any] | None = None,
- value_model: type[boilercv.pipelines.Pipeline[boilercv.pipelines.types.K, boilercv.pipelines.types.V] | boilercv.pipelines.PipelineBase | pydantic.BaseModel] | None = None,
- value_context: boilercv.pipelines.contexts.PipelineCtx | None = None,
Compose defaults.
- class boilercv.pipelines.Defaults#
Bases:
boilercv.pipelines.pipes.ContextValue
,typing.Generic
[boilercv.pipelines.types.K
,boilercv.pipelines.types.V
]Context for expression validation.
- mapping: dict[boilercv.pipelines.types.K, boilercv.pipelines.types.V]#
‘field(…)’
Mapping of keys to their default values.
- factory: collections.abc.Callable[..., Any] | None#
None
Default value factory.
- value_copier: collections.abc.Callable[[boilercv.pipelines.types.V], boilercv.pipelines.types.V] | None#
None
Method to copy the default value.
- boilercv.pipelines.set_defaults(
- i: dict[boilercv.pipelines.types.K, boilercv.pipelines.types.V],
- d: boilercv.pipelines.Defaults[boilercv.pipelines.types.K, boilercv.pipelines.types.V],
Set
self.default_keys
usingself.default_factory
orself.default
.
- boilercv.pipelines.compose_contexts(
- *contexts: boilercv.pipelines.contexts.PipelineCtx,
Compose contexts.
- boilercv.pipelines.make_pipelines(
- typ: type,
- /,
- before: collections.abc.Sequence[boilercv.pipelines.pipes.types.AnyPipe] | boilercv.pipelines.pipes.types.AnyPipe | None = None,
- after: collections.abc.Sequence[boilercv.pipelines.pipes.types.AnyPipe] | boilercv.pipelines.pipes.types.AnyPipe | None = None,
Compose defaults.
- boilercv.pipelines.compose_context(
- *context_values: boilercv.pipelines.pipes.ContextValue,
Compose inner contexts.