lookbook.manifest
Helpers for reading and writing the manifest.
The manifest is a MutableMapping[(image_id, metric_id), Annotation]. This module is a tiny ergonomics layer on top — nothing here is essential to the abstraction; it exists so callers don’t have to spell out tuple keys.
- lookbook.manifest.get_annotation(manifest: MutableMapping[Tuple[str, str], Annotation], image_id: str, metric_id: str) Annotation | None[source]
Return the annotation if present, else None.
- lookbook.manifest.image_ids(manifest: MutableMapping[Tuple[str, str], Annotation]) Iterable[str][source]
The set of distinct image_ids that appear in the manifest.
- lookbook.manifest.iter_annotations_for(manifest: MutableMapping[Tuple[str, str], Annotation], image_id: str) Iterator[Annotation][source]
Yield every annotation for a given image.
- lookbook.manifest.put_annotation(manifest: MutableMapping[Tuple[str, str], Annotation], annotation: Annotation) None[source]
Write an annotation to the manifest, keyed by (image_id, metric_id).
- lookbook.manifest.value_of(manifest: MutableMapping[Tuple[str, str], Annotation], image_id: str, metric_id: str, default: Any = None) Any[source]
Return the bare value of an annotation (not the wrapper), or default.