@@ -1273,6 +1273,7 @@ def fake_store_probabilities(
12731273 * _ : Any , # noqa: ANN401
12741274 ** __ : Any , # noqa: ANN401
12751275 ) -> tuple [zarr .Array | None , da .Array | None ]:
1276+ """Record unexpected probability-store calls during merge tests."""
12761277 nonlocal called_store
12771278 called_store = True
12781279 return None , None
@@ -1719,26 +1720,31 @@ def test_post_save_json_store_deletes_empty_store(
17191720 # ---- Proxy object that LOOKS like a zarr.Group ----
17201721 class GroupProxy :
17211722 def __init__ (self : GroupProxy , group : zarr .Group , path : Path | str ) -> None :
1723+ """Wrap a Zarr group with a path used by cleanup code."""
17221724 self ._group = group
17231725 self .path = path
17241726 self .store = group .store
17251727
17261728 # Make isinstance(proxy, zarr.Group) return True
17271729 @property
17281730 def __class__ (self : GroupProxy ) -> type [zarr .Group ]:
1731+ """Expose the wrapped object as a Zarr group for isinstance."""
17291732 return zarr .Group
17301733
17311734 # Delegate attribute access
17321735 def __getattr__ (
17331736 self : GroupProxy , item : str
17341737 ) -> zarr .Group | zarr .Array | str | int | float | Iterable [str ]:
1738+ """Delegate unknown attributes to the wrapped Zarr group."""
17351739 return getattr (self ._group , item )
17361740
17371741 # Delegate mapping behavior
17381742 def keys (self : GroupProxy ) -> Iterable [str ]:
1743+ """Return keys from the wrapped Zarr group."""
17391744 return self ._group .keys ()
17401745
17411746 def __getitem__ (self : GroupProxy , item : str ) -> zarr .Group | zarr .Array :
1747+ """Return an item from the wrapped Zarr group."""
17421748 return self ._group [item ]
17431749
17441750 processed_predictions = GroupProxy (root , "dummy" )
@@ -1747,6 +1753,7 @@ def __getitem__(self: GroupProxy, item: str) -> zarr.Group | zarr.Array:
17471753 called = {"flag" : False }
17481754
17491755 def fake_rmtree (path : Path | str , * , ignore_errors : bool ) -> None : # noqa: ARG001
1756+ """Record that cleanup attempted to remove an empty Zarr store."""
17501757 called ["flag" ] = True
17511758
17521759 monkeypatch .setattr (shutil , "rmtree" , fake_rmtree )
@@ -1830,6 +1837,7 @@ def fake_save_qupath_json(
18301837 save_path : Path | None , # noqa: ARG001
18311838 qupath_json : dict [str , Any ],
18321839 ) -> dict [str , Any ]:
1840+ """Return generated QuPath JSON instead of writing it to disk."""
18331841 return qupath_json
18341842
18351843 monkeypatch .setattr (
@@ -1866,6 +1874,7 @@ def _build_single_qupath_feature(
18661874 scale_factor : tuple [float , float ],
18671875 class_colors : dict [int , Any ],
18681876 ) -> dict [str , Any ]:
1877+ """Delegate feature construction to the production JSON store."""
18691878 return DaskDelayedJSONStore ._build_single_qupath_feature (
18701879 self , i , class_dict , origin , scale_factor , class_colors
18711880 )
0 commit comments