phenotypic.sdk_.BundleLayout#
- class phenotypic.sdk_.BundleLayout(deliverables_base: Path, output_root: Path | None)[source]#
Bases:
objectResolved on-disk topology of a run output or a standalone deliverables bundle.
Separates the deliverables base (the folder directly holding
master_measurements.parquet) from the optional output root (the parent that also holdsresults/and.phenotypic/). A standalone bundle hasoutput_root is None; deliverables-internal artefacts always resolve fromdeliverables_baseso the bundle is portable.- deliverables_base#
Folder containing
master_measurements.parquet.- Type:
- output_root#
Parent run directory holding
results/+ machine state, orNonefor a standalone (deliverables-only) bundle.- Type:
pathlib.Path | None
Methods
__init__Classify
pathas a run output dir or a standalone deliverables bundle.Return path to
errors/<category>.parquet.Full-res per-image HDF for
(dataset, stem), orNoneif unavailable.Return path to
overlays/<dataset>/<stem>.png.Return path to
overlays/<dataset>/.Attributes
Return path to
analysis.csvin the deliverables base.Return path to
analysis.parquetin the deliverables base.Return path to
deliverables/qc/curation_labels.parquet(durable labels store).Return path to
deliverables/qc/custom_categories.json(custom-category registry).Return path to
error_analysis.csvin the deliverables base.Return path to
error_analysis.htmlin the deliverables base.Return path to
error_analysis.parquetin the deliverables base.Return path to the
errors/directory under the deliverables base.Return
Truewhen aresults/directory exists under the output root.Return path to
master_measurements.csvin the deliverables base.Return path to
master_measurements.parquetin the deliverables base.Return path to
measurements.csv(post-applied mirror).Return path to
measurements.parquet(post-applied mirror).Return path to
pipeline.jsonin the deliverables base.Return the QC directory, resolving legacy
<output>/qc/layouts.Return path to
qc/qc.duckdb(the QC analysis database).Return path to
deliverables/qc/review_state.json(GUI-owned review progress).Return the best existing pipeline config path inside the bundle.
Return the
results/directory, orNonefor a standalone bundle.Return path to
verified.parquet(GUI-written verified-good archive).- classmethod detect(path: Path) BundleLayout[source]#
Classify
pathas a run output dir or a standalone deliverables bundle.Case 1 —
pathdirectly holdsmaster_measurements.parquet: treat it as the deliverables base. Promotepath.parenttooutput_rootONLY whenpathis literally nameddeliverablesAND a siblingresults/exists (the “pointed at the deliverables subdir of a full run” case); this guard stops a renamed standalone bundle from adopting an unrelated siblingresults/.Case 2 —
pathcontainsdeliverables/master_measurements.parquet:deliverables_base = path/deliverablesandoutput_root = path.- Parameters:
path (Path) – Either a run output directory (containing a
deliverables/subdirectory) or a standalone deliverables folder (directly containingmaster_measurements.parquet).- Returns:
A
BundleLayoutwith resolveddeliverables_baseandoutput_root.- Raises:
FileNotFoundError –
pathis neither a run output directory nor a deliverables bundle.- Return type:
- hdf_path(dataset: str, stem: str) Path | None[source]#
Full-res per-image HDF for
(dataset, stem), orNoneif unavailable.
- property resolved_pipeline_config_path: Path#
Return the best existing pipeline config path inside the bundle.
Mirrors
resolve_pipeline_config_path()’s precedence but anchored ondeliverables_base(so a standalone bundle resolves inside itself without double-joiningdeliverables/): the canonical typed config when present, else the legacy plainpipeline.jsonwhen present, else the canonical path (so writers naturally create typed config files).
- property qc_dir: Path#
Return the QC directory, resolving legacy
<output>/qc/layouts.Prefers
deliverables/qc/when it exists. Falls back to the legacy root<output>/qc/when only that exists (pre-relocation runs). Returns the canonicaldeliverables/qc/path for fresh writes when neither is present.
- property qc_review_state_path: Path#
Return path to
deliverables/qc/review_state.json(GUI-owned review progress).
- property curation_labels_parquet: Path#
Return path to
deliverables/qc/curation_labels.parquet(durable labels store).
- property custom_categories_json: Path#
Return path to
deliverables/qc/custom_categories.json(custom-category registry).
- property error_analysis_parquet: Path#
Return path to
error_analysis.parquetin the deliverables base.
- property verified_parquet: Path#
Return path to
verified.parquet(GUI-written verified-good archive).