phenotypic.sdk_.read_embedded_measurement_descriptor#
- phenotypic.sdk_.read_embedded_measurement_descriptor(store_path: Path) dict[str, object][source]#
Return one store’s
tables.measurementsdescriptor.The descriptor is the store’s own account of its embedded table: the payload path, the
measurement_columnslist, and thetargetnaming the join column and the label image it indexes. Reading it costs one small JSON parse and never opens the Parquet payload, so a caller that only needs the column list – a column picker, say – pays nothing for the ~130 columns it does not want.- Parameters:
store_path (Path) – Path to a
*.ome.zarrdirectory.- Returns:
The descriptor mapping, exactly as
build_measurement_table_descriptor()wrote it.- Raises:
OSError – If the store’s root
zarr.jsondoes not exist.KeyError – If the root carries no
phenotypicblock, or the block declares notables.measurementsdescriptor. An absent descriptor is a normal state, not a fault: a--mode processrun never measures, and a store written before embedded tables has none.ValueError – If the store’s
store_schema_versionis not this build’s – the same refusal every other content reader makes.
- Return type:
Examples
>>> import tempfile >>> from pathlib import Path >>> from phenotypic import GridImage >>> from phenotypic.data import load_synth_yeast_plate >>> img = GridImage(load_synth_yeast_plate()) >>> with tempfile.TemporaryDirectory() as tmp: ... store = img.save2zarr(Path(tmp) / 'plate.ome.zarr') ... try: ... read_embedded_measurement_descriptor(store) ... except KeyError: ... print('no embedded table') no embedded table