boilercv_pipeline.models.dvc

Contents

boilercv_pipeline.models.dvc#

Model for dvc.yaml.

Adapted from iterative/dvcyaml-schema.

Notes#

The original license is reproduced below.

Copyright 2020-2021 Iterative, Inc.

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Module Contents#

Classes#

Data#

API#

boilercv_pipeline.models.dvc.FilePath: TypeAlias#

None

boilercv_pipeline.models.dvc.VarKey: TypeAlias#

None

boilercv_pipeline.models.dvc.StageName: TypeAlias#

None

boilercv_pipeline.models.dvc.PlotIdOrFilePath: TypeAlias#

None

boilercv_pipeline.models.dvc.PlotColumn: TypeAlias#

None

boilercv_pipeline.models.dvc.PlotColumns: TypeAlias#

None

boilercv_pipeline.models.dvc.PlotTemplateName: TypeAlias#

None

class boilercv_pipeline.models.dvc.DvcBaseModel(
/,
**data: typing.Any,
)#

Bases: pydantic.BaseModel

class boilercv_pipeline.models.dvc.OutFlags(
/,
**data: typing.Any,
)#

Bases: boilercv_pipeline.models.dvc.DvcBaseModel

model_config#

‘ConfigDict(…)’

cache: bool | None#

True

Cache output by DVC

persist: bool | None#

False

Persist output between runs

checkpoint: bool | None#

False

Indicate that the output is associated with in-code checkpoints

desc: str | None#

‘Field(…)’

User description for the output

type: str | None#

None

User assigned type of the output

labels: list[str]#

‘Field(…)’

User assigned labels of the output

meta: dict[str, Any]#

‘Field(…)’

Custom metadata of the output.

remote: str | None#

None

Name of the remote to use for pushing/fetching

push: bool | None#

True

Whether the output should be pushed to remote during dvc push

class boilercv_pipeline.models.dvc.PlotFlags(
/,
**data: typing.Any,
)#

Bases: boilercv_pipeline.models.dvc.OutFlags

x: boilercv_pipeline.models.dvc.PlotColumn | None#

None

Default field name to use as x-axis data

y: boilercv_pipeline.models.dvc.PlotColumn | None#

None

Default field name to use as y-axis data

x_label: str | None#

None

Default label for the x-axis

y_label: str | None#

None

Default label for the y-axis

title: str | None#

None

Default plot title

header: bool#

False

Whether the target CSV or TSV has a header or not

template: boilercv_pipeline.models.dvc.FilePath | None#

None

Default plot template

boilercv_pipeline.models.dvc.X: TypeAlias#

None

boilercv_pipeline.models.dvc.Y: TypeAlias#

None

class boilercv_pipeline.models.dvc.TopLevelPlotFlags(
/,
**data: typing.Any,
)#

Bases: boilercv_pipeline.models.dvc.DvcBaseModel

model_config#

‘ConfigDict(…)’

x: boilercv_pipeline.models.dvc.PlotColumn | boilercv_pipeline.models.dvc.X#

None

A single column name, or a dictionary of data-source and column pair

y: boilercv_pipeline.models.dvc.PlotColumns | boilercv_pipeline.models.dvc.Y#

None

A single column name, list of columns, or a dictionary of data-source and column pair

x_label: str | None#

None

Default label for the x-axis

y_label: str | None#

None

Default label for the y-axis

title: str | None#

None

Default plot title

template: str#

‘linear’

Default plot template

boilercv_pipeline.models.dvc.EmptyTopLevelPlotFlags: TypeAlias#

None

class boilercv_pipeline.models.dvc.TopLevelArtifactFlags(
/,
**data: typing.Any,
)#

Bases: boilercv_pipeline.models.dvc.DvcBaseModel

model_config#

‘ConfigDict(…)’

path: str#

None

Path to the artifact

type: str | None#

None

Type of the artifact

desc: str | None#

None

Description for the artifact

meta: dict[str, Any]#

‘Field(…)’

Custom metadata for the artifact

labels: list[str]#

‘Field(…)’

Labels for the artifact

boilercv_pipeline.models.dvc.DepModel: TypeAlias#

None

boilercv_pipeline.models.dvc.Dependencies: TypeAlias#

None

boilercv_pipeline.models.dvc.ParamKey: TypeAlias#

None

boilercv_pipeline.models.dvc.CustomParamFileKeys: TypeAlias#

None

boilercv_pipeline.models.dvc.EmptyParamFileKeys: TypeAlias#

None

boilercv_pipeline.models.dvc.Param#

None

boilercv_pipeline.models.dvc.Params#

None

boilercv_pipeline.models.dvc.Out: TypeAlias#

None

boilercv_pipeline.models.dvc.Outs#

None

boilercv_pipeline.models.dvc.Metric: TypeAlias#

None

boilercv_pipeline.models.dvc.Plot: TypeAlias#

None

boilercv_pipeline.models.dvc.Plots#

None

boilercv_pipeline.models.dvc.VarPath: TypeAlias#

None

boilercv_pipeline.models.dvc.VarDecl: TypeAlias#

None

boilercv_pipeline.models.dvc.Vars#

None

class boilercv_pipeline.models.dvc.Stage(
/,
**data: typing.Any,
)#

Bases: boilercv_pipeline.models.dvc.DvcBaseModel

A named stage of a 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#

‘ConfigDict(…)’

cmd: str | list[str]#

None

(Required) Command to run (anything your system terminal can run).

Can be a string or a list of commands.

wdir: str | None#

None

Working directory for the cmd, relative to dvc.yaml

deps: boilercv_pipeline.models.dvc.Dependencies#

‘Field(…)’

List of the dependencies for the stage.

params: boilercv_pipeline.models.dvc.Params#

‘Field(…)’

List of dot-separated parameter dependency keys to track from params.yaml.

May contain other YAML/JSON/TOML/Python parameter file names, with a sub-list of the param names to track in them (leave empty to include all).

outs: boilercv_pipeline.models.dvc.Outs#

‘Field(…)’

List of the outputs of the stage.

metrics: boilercv_pipeline.models.dvc.Outs#

‘Field(…)’

List of metrics of the stage written to JSON/TOML/YAML.

plots: boilercv_pipeline.models.dvc.Plots#

‘Field(…)’

List of plots of the stage for visualization.

Plots may be written to JSON/YAML/CSV/TSV for data or JPEG/GIF/PNG for images.

frozen: bool | None#

False

Assume stage as unchanged

always_changed: bool | None#

False

Assume stage as always changed

vars: boilercv_pipeline.models.dvc.Vars#

‘Field(…)’

List of stage-specific values for substitution.

May include any dict or a path to a params file.

Use in the stage with the ${} substitution expression.

desc: str | None#

None

Description of the stage

meta: Any#

None

Additional information/metadata

boilercv_pipeline.models.dvc.ParametrizedString: TypeAlias#

None

class boilercv_pipeline.models.dvc.ForeachDo(
/,
**data: typing.Any,
)#

Bases: boilercv_pipeline.models.dvc.DvcBaseModel

model_config#

‘ConfigDict(…)’

foreach: boilercv_pipeline.models.dvc.ParametrizedString | list[Any] | dict[str, Any]#

None

Iterable to loop through in foreach. Can be a parametrized string, list or a dict.

The stages will be generated by iterating through this data, by substituting data in the do block.

do: boilercv_pipeline.models.dvc.Stage#

None

Parametrized stage definition that’ll be substituted over for each of the value from the foreach data.

class boilercv_pipeline.models.dvc.Matrix(
/,
**data: typing.Any,
)#

Bases: boilercv_pipeline.models.dvc.Stage

model_config#

‘ConfigDict(…)’

matrix: dict[str, list[Any] | boilercv_pipeline.models.dvc.ParametrizedString]#

‘Field(…)’

Generate stages based on combination of variables.

The variable can be a list of values, or a parametrized string referencing a list.

boilercv_pipeline.models.dvc.Definition#

None

boilercv_pipeline.models.dvc.TopLevelPlots: TypeAlias#

None

boilercv_pipeline.models.dvc.TopLevelPlotsList: TypeAlias#

None

boilercv_pipeline.models.dvc.ArtifactIdOrFilePath: TypeAlias#

None

boilercv_pipeline.models.dvc.TopLevelArtifacts: TypeAlias#

None

class boilercv_pipeline.models.dvc.DvcYamlModel(
/,
**data: typing.Any,
)#

Bases: boilercv_pipeline.models.dvc.DvcBaseModel

model_config#

‘ConfigDict(…)’

vars: boilercv_pipeline.models.dvc.Vars#

‘Field(…)’

List of values for substitution.

May include any dict or a path to a params file which may be a string or a dict to params in the file).

Use elsewhere in dvc.yaml with the ${} substitution expression.

stages: dict[boilercv_pipeline.models.dvc.StageName, boilercv_pipeline.models.dvc.Definition]#

‘Field(…)’

List of stages that form a pipeline.

plots: boilercv_pipeline.models.dvc.TopLevelPlots | boilercv_pipeline.models.dvc.TopLevelPlotsList#

‘Field(…)’

Top level plots definition.

params: list[boilercv_pipeline.models.dvc.FilePath]#

‘Field(…)’

List of parameter files

metrics: list[boilercv_pipeline.models.dvc.FilePath]#

‘Field(…)’

List of metric files

artifacts: boilercv_pipeline.models.dvc.TopLevelArtifacts#

‘Field(…)’

Top level artifacts definition.