pydox.figures.commit

Contents

pydox.figures.commit#

figures.commit(fig: Figure, name: str, category: str | None = None, watermark: str | None = None, config_uid: str | None = None, dest: Path | None = None) → PydoxFigure#

Commit a named matplotlib.figure.Figure object to the global registry of figures

This function is to be called from anywhere in the library.

A commit is the following set of operations:

Use the registry to report/show figures matching some criteria based on meta-data filtering.

Parameters:
  • fig (matplotlib.figure.Figure) – The matplotlib.figure.Figure instance to commit.

  • name (str) – The string name given to the figure.

  • category (str, default=None) – The figure category to assign to this figure. Possible values are given in pydox.commodities.VALID_FIGURE_CATEGORIES.

  • watermark (str, default = None) – If the plots.watermark.show setting is True, print this watermark on the figure. Note that the default watermark (from plots.watermark.default setting) is always added, even if this argument is None.

  • config_uid (str, default=None) – The unique configuration ID to associate this figure with. This is typically a configuration UID, as return by pydox.calibration.spec.Workflow.uid().

  • dest (Optional[Path]) – Destination folder of the figure pickle file. Default path is given by pydox.tmp_root(). Note that this is not the report output path, this path is likely temporary.