chemparseplot.plot.provenance#
Deterministic figure files that record where they came from.
- func:
save_with_provenancewrites PNG, PDF or SVG with fonts embedded, no timestamps and a fixed SVG id salt, so equal inputs give equal bytes. The file carries a JSON description with the SHA-256 of each input and the versions of the tools that drew it.
.. versionadded:: 1.10.0
Module Contents#
Functions#
Installed versions of the plotting stack; absent packages are omitted. |
|
Hex SHA-256 of a file. |
|
Provenance record: input hashes (by name), command line, tool versions. |
|
Save |
Data#
API#
- chemparseplot.plot.provenance._TOOLS#
(‘chemparseplot’, ‘rgpycrumbs’, ‘matplotlib’, ‘numpy’)
- chemparseplot.plot.provenance._SVG_SALT#
‘chemparseplot’
- chemparseplot.plot.provenance._CREATOR#
‘chemparseplot’
- chemparseplot.plot.provenance.tool_versions(extra: tuple[str, ...] = ()) dict[str, str]#
Installed versions of the plotting stack; absent packages are omitted.
- chemparseplot.plot.provenance.file_sha256(path: str | pathlib.Path) str#
Hex SHA-256 of a file.
- chemparseplot.plot.provenance.describe(inputs: dict[str, str | pathlib.Path], command: str = '', hashes: dict[str, str] | None = None) dict#
Provenance record: input hashes (by name), command line, tool versions.
inputsare files to hash;hashesare digests already computed (a parser’sprovenance), merged under the same key space.
- chemparseplot.plot.provenance.save_with_provenance(fig, output: str | pathlib.Path, inputs: dict[str, str | pathlib.Path], *, command: str = '', hashes: dict[str, str] | None = None, dpi: int = 200, sidecar: bool = True) dict#
Save
figdeterministically and return the provenance record.The format follows the suffix (
.png,.pdf,.svg). Withhashesadds digests computed elsewhere. Withsidecara<output>.provenance.jsonis written beside the figure.
- chemparseplot.plot.provenance.__all__#
[‘describe’, ‘file_sha256’, ‘save_with_provenance’, ‘tool_versions’]