boilercv_pipeline.models.params#

Pipeline stages model.

Submodules#

Package Contents#

Classes#

Constants

Parameter constants.

Params

Stage parameters.

DataParams

Stage parameters.

Functions#

set_display_options

Set display options.

display_markdown

Render dataframes as Markdown, facilitating MathJax rendering.

head

get_floatfmt

Get floating number format at given precision.

Data#

API#

class boilercv_pipeline.models.params.Constants(
/,
**data: typing.Any,
)#

Bases: pydantic.BaseModel

Parameter 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.

scale: float#

1.3

paper_scale: float#

1.0

precision: int#

3

display_rows: int#

12

boilercv_pipeline.models.params.const#

‘Constants(…)’

boilercv_pipeline.models.params.set_display_options(
scale: float = const.scale,
precision: int = const.precision,
display_rows: int = const.display_rows,
)#

Set display options.

boilercv_pipeline.models.params.display_markdown(
df: pandas.DataFrame,
floatfmt: str = '#.3g',
)#

Render dataframes as Markdown, facilitating MathJax rendering.

Notes#

jupyter-book/jupyter-book#1501

boilercv_pipeline.models.params.head(
df: pandas.DataFrame,
) pandas.DataFrame#
boilercv_pipeline.models.params.get_floatfmt(
precision: int = 3,
) str#

Get floating number format at given precision.

class boilercv_pipeline.models.params.Params(
/,
**data: context_models.types.Data,
)#

Bases: boilercv_pipeline.models.stage.Stage, typing.Generic[boilercv_pipeline.models.params.types.Deps_T, boilercv_pipeline.models.params.types.Outs_T]

Stage parameters.

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.

deps: boilercv_pipeline.models.params.types.Deps_T#

None

Stage dependencies.

outs: boilercv_pipeline.models.params.types.Outs_T#

None

Stage outputs.

scale: float#

None

Plot scale.

marker_scale: float#

20

Marker scale.

precision: int#

None

Number precision.

display_rows: int#

None

Number of rows to display in data frames.

property size: float#

Marker size.

property floatfmt: str#

Floating number format.

property font_scale: float#

Font scale.

set_display_options(
scale: float | None = None,
precision: int | None = None,
display_rows: int | None = None,
)#

Set display options.

move_legend(
ax: matplotlib.axes.Axes,
loc='lower center',
bbox_to_anchor=(0.5, 1.0),
ncol=3,
)#

Move legend.

preview(
df: boilercv_pipeline.models.params.types.DfOrS_T,
cols: collections.abc.Iterable[boilercv_pipeline.models.column.Col] | None = None,
index: boilercv_pipeline.models.column.Col | None = None,
f: boilercv_pipeline.models.params.types.Preview[boilercv_pipeline.models.column.types.Ps] = head,
ncol: int = 0,
*args: boilercv_pipeline.models.column.types.Ps.args,
**kwds: boilercv_pipeline.models.column.types.Ps.kwargs,
) boilercv_pipeline.models.params.types.DfOrS_T#

Preview a dataframe in the notebook.

classmethod hide()#

Hide unsuppressed output in notebook cells.

display_options(
scale: float = const.scale,
precision: int = const.precision,
display_rows: int = const.display_rows,
)#

Display options.

class boilercv_pipeline.models.params.DataParams#

Bases: boilercv_pipeline.models.params.Params[boilercv_pipeline.models.params.types.Deps_T, boilercv_pipeline.models.params.types.Outs_T], typing.Generic[boilercv_pipeline.models.params.types.Deps_T, boilercv_pipeline.models.params.types.Outs_T, boilercv_pipeline.models.params.types.Data_T]

Stage parameters.

model_config#

‘get_boilercv_pipeline_config(…)’

dvc_validate_params(
info: boilercv_pipeline.sync_dvc.types.DvcValidationInfo,
) Self#

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

data: boilercv_pipeline.models.params.types.Data_T#

None

Stage data.