From eb9b2dd5ad179b23c70640dbf0c262afe0608cd9 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Nov 2026 07:37:58 +0000 Subject: [PATCH 01/23] CP-2b: remove code no file or in-memory run reaches since CP-2a Pure removal, no behaviour change: pipeline.check_source_identities, ids.object_set_from_label_path, io.read_ngff_mask, io.refuse_mask_channel_axis and planes.iter_file_planes have had no caller since file runs read through the preprocessing run's RunInputs (CP-2a). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc --- src/cellpatcher/ids.py | 6 --- src/cellpatcher/io.py | 82 ------------------------------------- src/cellpatcher/pipeline.py | 17 -------- src/cellpatcher/planes.py | 47 ++------------------- tests/test_file_runs.py | 2 +- 5 files changed, 4 insertions(+), 150 deletions(-) diff --git a/src/cellpatcher/ids.py b/src/cellpatcher/ids.py index f76dada..2f49e42 100644 --- a/src/cellpatcher/ids.py +++ b/src/cellpatcher/ids.py @@ -100,12 +100,6 @@ def object_set_from_mask_type(mask_type) -> str | None: return re.sub(r"[^A-Za-z0-9._-]", "_", str(mask_type)).strip("_") or None -def object_set_from_label_path(mask_file) -> str: - """The label image name of an OME-NGFF mask ``/labels/`` (``io.read_ngff_mask``).""" - name = str(mask_file).rsplit("/", 1)[-1] - return re.sub(r"[^A-Za-z0-9._-]", "_", name).strip("_") or DEFAULT_OBJECT_SET - - def resolve_object_set(meta, common) -> str: """The ``object_set`` of a cell-mode image. diff --git a/src/cellpatcher/io.py b/src/cellpatcher/io.py index 70aeffa..e6736d5 100644 --- a/src/cellpatcher/io.py +++ b/src/cellpatcher/io.py @@ -499,72 +499,6 @@ def read_ome_zarr(path) -> tuple[np.ndarray, str]: return pixels, image.axes -def read_ngff_mask(path, label_name: str | None, axes: str) -> tuple[np.ndarray, str]: - """Read an OME-Zarr image's label image as its mask, put into *axes* by role. - - Follows ``docs/normalization_contract.md`` §4: the label image comes from - the image's ``labels`` group (*label_name* may be None when it has exactly - one), level 0 is read, its values must be integers, and each of its - dimensions must equal the image's or have length 1 (a channel axis, length - 1). A label Z or T axis with the image's length then follows the image's - planes, and one of length 1 is shared (``common.z_policy``/``t_policy``). - - Returns - ------- - tuple - The mask in *axes*, and its ``mask_file`` name, - ``/labels/