Skip to content

Commit

Permalink
Merge pull request #86 from blowekamp/duplicate_series_path
Browse files Browse the repository at this point in the history
Add exception when duplicate series zarr paths are detected.
  • Loading branch information
blowekamp authored Oct 3, 2023
2 parents 9f2325f + a781f5f commit 9df62a1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pytools/HedwigZarrImages.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ def __getitem__(self, item) -> HedwigZarrImage:
for k_idx, k in enumerate(self.get_series_keys()):
if item == k and "OME" in self.zarr_root.group_keys():
ome_index_to_zarr_group = self.zarr_root["OME"].attrs["series"]

if len(ome_index_to_zarr_group) != len(set(ome_index_to_zarr_group)):
raise RuntimeError(f'The OME "series" contains duplicated paths: f{ome_index_to_zarr_group}')

zarr_idx = ome_index_to_zarr_group[k_idx]
return HedwigZarrImage(self.zarr_root[zarr_idx], self.ome_info, k_idx)

Expand Down

0 comments on commit 9df62a1

Please sign in to comment.