mecfs_bio.figures.manifest_validation
Check that the figure manifest is a subset of the figures produced by the configured task list.
The manifest is the source of truth for which figure files documentation depends on; the task list is the source of truth for how those files are built. If the two drift apart --- a manifest path with no task to produce it --- documentation builds can succeed locally (because the file is already in the figure directory) but fail for any collaborator who has to pull and regenerate from scratch. This module catches that drift.
Classes:
-
ManifestTaskMismatchError–Raised when the manifest references paths no task in the list produces.
Functions:
-
find_orphan_paths–Return the paths in
pathsthat no task intasksproduces. -
validate_manifest_subset_of_tasks–Raises ManifestTaskMismatchError if any manifest path is uncovered by
tasks.
ManifestTaskMismatchError
Bases: ValueError
Raised when the manifest references paths no task in the list produces.
find_orphan_paths
Return the paths in paths that no task in tasks produces.
A path is covered (i.e. not an orphan) when either: - it matches exactly the destination of a file-emitting task, or - it lies inside the destination directory of a directory-emitting task.
The caller decides which paths to consider --- typically manifest keys for validation, or the union of manifest keys and on-disk files for pruning. Result is sorted for stable error messages and pruning order.
Source code in mecfs_bio/figures/manifest_validation.py
validate_manifest_subset_of_tasks
validate_manifest_subset_of_tasks(
manifest: FigureManifest,
tasks: Sequence[Task],
fig_dir: Path,
) -> None
Raises ManifestTaskMismatchError if any manifest path is uncovered by tasks.