boilercv_pipeline.models.path#

Path models.

Submodules#

Package Contents#

Classes#

Functions#

get_times

Get timestamps from a pattern-filtered directory.

get_time

Get timestamp from a path.

get_boilercv_pipeline_context

Context for boilercv_pipeline.

get_boilercv_pipeline_config

Model config for boilercv_pipeline.

make_path

Check path kind and make a directory and its parents or a file’s parents.

resolve_path

Resolve paths and serialize POSIX-style.

ser_rooted_path

Serialize paths POSIX-style, resolving if rooted.

get_path_time

Get a path-friendly time string.

Data#

HiddenContext

Pipeline context as a hidden argument.

make_path_args

make_path() args and their kinds.

FilePathSerPosix

Directory path that serializes as POSIX.

DirectoryPathSerPosix

Directory path that serializes as POSIX.

DataDir

Data directory path made upon validation.

DataFile

Data file path made upon validation.

DocsDir

Docs directory path made upon validation.

DocsFile

Docs file path made upon validation.

API#

boilercv_pipeline.models.path.get_times(
directory: pathlib.Path,
pattern: str,
) list[str]#

Get timestamps from a pattern-filtered directory.

boilercv_pipeline.models.path.get_time(
path: pathlib.Path,
) str#

Get timestamp from a path.

boilercv_pipeline.models.path.get_boilercv_pipeline_context(
roots: boilercv_pipeline.models.contexts.Roots | None = None,
kinds_from: BoilercvPipelineContextStore | None = None,
track_kinds: bool = False,
sync_dvc: bool = False,
) boilercv_pipeline.models.contexts.BoilercvPipelineContexts#

Context for boilercv_pipeline.

boilercv_pipeline.models.path.get_boilercv_pipeline_config(
roots: boilercv_pipeline.models.contexts.Roots | None = None,
kinds_from: BoilercvPipelineContextStore | None = None,
track_kinds: bool = False,
dvc: bool = False,
) boilercv_pipeline.models.contexts.types.BoilercvPipelineConfigDict#

Model config for boilercv_pipeline.

boilercv_pipeline.models.path.HiddenContext#

None

Pipeline context as a hidden argument.

class boilercv_pipeline.models.path.BoilercvPipelineContextStore(
/,
**data: context_models.types.Data,
)#

Bases: context_models.ContextStore

Context model for boilercv_pipeline.

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 allow self as a field name.

model_config: ClassVar[boilercv_pipeline.models.contexts.types.BoilercvPipelineConfigDict]#

‘get_boilercv_pipeline_config(…)’

context: boilercv_pipeline.models.path.HiddenContext#

‘BoilercvPipelineContexts(…)’

classmethod context_get(
data: context_models.types.Data,
context: context_models.types.Context | None = None,
context_base: context_models.types.Context | None = None,
) context_models.types.Context#

Get context from data.

unset_kinds() Self#

Unset kinds to avoid re-checking them.

boilercv_pipeline.models.path.make_path_args: dict[tuple[boilercv_pipeline.models.path.types.Key, bool], boilercv_pipeline.models.contexts.types.Kind]#

None

make_path() args and their kinds.

boilercv_pipeline.models.path.make_path(
path: pathlib.Path,
info: boilercv_pipeline.models.contexts.types.BoilercvPipelineValidationInfo,
key: boilercv_pipeline.models.path.types.Key,
file: bool,
) pathlib.Path#

Check path kind and make a directory and its parents or a file’s parents.

boilercv_pipeline.models.path.resolve_path(
value: pathlib.Path | str,
nxt: pydantic.SerializerFunctionWrapHandler,
) str#

Resolve paths and serialize POSIX-style.

boilercv_pipeline.models.path.ser_rooted_path(
value: pathlib.Path | str,
nxt: pydantic.SerializerFunctionWrapHandler,
info: boilercv_pipeline.models.contexts.types.BoilercvPipelineSerializationInfo,
key: boilercv_pipeline.models.path.types.Key,
) str#

Serialize paths POSIX-style, resolving if rooted.

boilercv_pipeline.models.path.FilePathSerPosix: TypeAlias#

None

Directory path that serializes as POSIX.

boilercv_pipeline.models.path.DirectoryPathSerPosix: TypeAlias#

None

Directory path that serializes as POSIX.

boilercv_pipeline.models.path.DataDir: TypeAlias#

None

Data directory path made upon validation.

boilercv_pipeline.models.path.DataFile: TypeAlias#

None

Data file path made upon validation.

boilercv_pipeline.models.path.DocsDir: TypeAlias#

None

Docs directory path made upon validation.

boilercv_pipeline.models.path.DocsFile: TypeAlias#

None

Docs file path made upon validation.

boilercv_pipeline.models.path.get_path_time(
time: str,
) str#

Get a path-friendly time string.