boilercv_pipeline.sync_dvc.validators#

Validators for syncing dvc.yaml and params.yaml with pipeline specification.

Module Contents#

Classes#

Constants

Constants.

Functions#

dvc_prepare_stage

Prepare a pipeline stage for dvc.yaml.

dvc_add_param

Add param to global parameters and stage command for dvc.yaml.

dvc_set_stage_path

Set stage path as a stage dep, plot, or out for dvc.yaml.

dvc_append_plot_name

Append plot name for dvc.yaml.

dvc_set_only_sample

Set the only sample for dvc.yaml if only_sample is enabled.

dvc_extend_with_timestamp_suffixed_plots

Extend stage plots for dvc.yaml with timestamp-suffixed plots.

dvc_extend_with_named_plots_if_missing

Extend stage plots for dvc.yaml with named plots if plots haven’t been set.

Data#

API#

class boilercv_pipeline.sync_dvc.validators.Constants(
/,
**data: typing.Any,
)#

Bases: pydantic.BaseModel

Constants.

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.

table_key: str#

None

Key for the global parameters table.

out_config: boilercv_pipeline.sync_dvc.dvc.OutFlags#

‘OutFlags(…)’

Default dvc.yaml configuration for outs.

skip_cloud: list[str]#

[‘data/cines’, ‘data/large_sources’]

These paths are too large and unwieldy to cache or push to cloud storage.

out_skip_cloud_config: boilercv_pipeline.sync_dvc.dvc.OutFlags#

‘OutFlags(…)’

Default dvc.yaml configuration for outs that skip the cloud.

boilercv_pipeline.sync_dvc.validators.const#

‘Constants(…)’

boilercv_pipeline.sync_dvc.validators.dvc_prepare_stage(
data: dict[str, Any],
handler: pydantic.functional_validators.ModelWrapValidatorHandler[boilercv_pipeline.sync_dvc.types.Model],
info: boilercv_pipeline.sync_dvc.types.DvcValidationInfo,
model: type[boilercv_pipeline.sync_dvc.types.Model],
) boilercv_pipeline.sync_dvc.types.Model#

Prepare a pipeline stage for dvc.yaml.

boilercv_pipeline.sync_dvc.validators.dvc_add_param(
value: Any,
info: boilercv_pipeline.sync_dvc.types.DvcValidationInfo,
fields: dict[str, pydantic.fields.FieldInfo],
) Any#

Add param to global parameters and stage command for dvc.yaml.

boilercv_pipeline.sync_dvc.validators.dvc_set_stage_path(
path: pathlib.Path,
info: boilercv_pipeline.sync_dvc.types.DvcValidationInfo,
kind: Literal[deps, outs],
) pathlib.Path#

Set stage path as a stage dep, plot, or out for dvc.yaml.

boilercv_pipeline.sync_dvc.validators.dvc_append_plot_name(
figure: matplotlib.figure.Figure,
info: boilercv_pipeline.sync_dvc.types.DvcValidationInfo,
) matplotlib.figure.Figure#

Append plot name for dvc.yaml.

boilercv_pipeline.sync_dvc.validators.dvc_set_only_sample(
only_sample: bool,
info: boilercv_pipeline.sync_dvc.types.DvcValidationInfo,
sample_field: str,
) bool#

Set the only sample for dvc.yaml if only_sample is enabled.

boilercv_pipeline.sync_dvc.validators.dvc_extend_with_timestamp_suffixed_plots(
times: list[str],
info: boilercv_pipeline.sync_dvc.types.DvcValidationInfo,
) list[str]#

Extend stage plots for dvc.yaml with timestamp-suffixed plots.

boilercv_pipeline.sync_dvc.validators.dvc_extend_with_named_plots_if_missing(
model: pydantic.BaseModel,
info: boilercv_pipeline.sync_dvc.types.DvcValidationInfo,
) Any#

Extend stage plots for dvc.yaml with named plots if plots haven’t been set.