zarr_filenames
anomaly_match.prediction.zarr_filenames
¶
Derive per-image filenames for a Zarr store.
Shared by :mod:subprocess_scripts.prediction_process_zarr (to tag its
store_results writes) and :mod:anomaly_match.pipeline.session (to
detect when an entire Zarr file is already scored and skip the
subprocess spawn entirely). Kept in one place so the two callers agree
byte-for-byte on what name a given index resolves to.
derive_filenames(zarr_path)
¶
Return the (filename ↔ zarr index) mapping used by prediction.
Looks for a parquet sidecar — pointed at either by the zarr's
metadata_file attribute or by <name>_metadata.parquet next
to the store — and pulls per-row filenames from
original_filename / filename / source_id (in that order
of preference). Falls back to {prefix}__image_{i:06d} when no
metadata is found or the row count doesn't match.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
zarr_path
|
str | Path
|
Path to the zarr store (file or directory). |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
List of filename strings, length equal to the zarr's |
list[str]
|
array length. Empty list if the |
list[str]
|
unreadable. |