mecfs_bio.figures.manifest
Manifest for the figure system.
The manifest is a JSON file committed to git that maps figure paths (relative to the figure directory) to the SHA-256 hash of the figure's content. It is the source of truth for which figures are "live" in the project.
Figure blobs are stored content-addressed on the GitHub release: the asset name on the release is the SHA-256 hash. Because storage is content-addressed and append-only, two collaborators updating the same figure never overwrite each other's blobs --- conflicts surface as ordinary git merge conflicts on the manifest JSON, where one hash must be chosen.
Classes:
-
FigureManifest–Mapping from figure path (relative to the figure directory) to the
Functions:
-
scan_figure_dir–Build a manifest by hashing every file under
fig_dirrecursively. -
sha256_of_file–
Attributes:
FigureManifest
Mapping from figure path (relative to the figure directory) to the SHA-256 hex digest of file contents.
Keys are Path objects in memory; they are serialised as POSIX
strings in the on-disk JSON so the manifest is portable across
operating systems.
Methods:
-
empty– -
hashes– -
load– -
save– -
with_entry– -
without_entry–
Attributes:
empty
classmethod
hashes
load
classmethod
Source code in mecfs_bio/figures/manifest.py
save
Source code in mecfs_bio/figures/manifest.py
with_entry
scan_figure_dir
Build a manifest by hashing every file under fig_dir recursively.
Paths are stored as Path objects relative to fig_dir.