Skip to content

Commit

Permalink
Fix well naming case mismatch bug (#254)
Browse files Browse the repository at this point in the history
* fix bug with mismatched row/col name case

* remove deadline for `test_apply_transform_to_zyx_and_save` and `test_process_single_position` - actually makes tests run faster

* try to fix test_combine_fovs_to_hcs

* skip test_combine_fovs_to_hcs

* test case sensitivity

* fix test

* Revert "test case sensitivity"

This reverts commit 53f42a1.

---------

Co-authored-by: Talon Chandler <[email protected]>
  • Loading branch information
ieivanov and talonchandler authored Oct 2, 2024
1 parent d6f7956 commit 88623ea
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion iohub/ngff/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def __delitem__(self, key):

def __contains__(self, key):
key = normalize_storage_path(key)
return key in self._member_names
return key.lower() in [name.lower() for name in self._member_names]

def __iter__(self):
yield from self._member_names
Expand Down
9 changes: 5 additions & 4 deletions tests/ngff/test_ngff.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,17 +681,18 @@ def test_position_scale(channels_and_random_5d):
assert dataset.scale == scale


@pytest.mark.skip(reason="https://github.com/czbiohub-sf/iohub/issues/255")
def test_combine_fovs_to_hcs():
fovs = {}
fov_paths = ("A/1/0", "B/1/0", "H/12/9")
for path in fov_paths:
with open_ome_zarr(hcs_ref) as hcs_store:
with open_ome_zarr(hcs_ref) as hcs_store:
for path in fov_paths:
fovs[path] = hcs_store["B/03/0"]
with TemporaryDirectory() as temp_dir:
store_path = os.path.join(temp_dir, "combined.zarr")
combined_plate = Plate.from_positions(store_path, fovs)
Plate.from_positions(store_path, fovs).close()
# read data with an external reader
ext_reader = Reader(parse_url(combined_plate.zgroup.store.path))
ext_reader = Reader(parse_url(store_path))
node = list(ext_reader())[0]
plate_meta = node.metadata["metadata"]["plate"]
assert len(plate_meta["rows"]) == 3
Expand Down
4 changes: 2 additions & 2 deletions tests/ngff/test_ngff_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ def test_create_empty_plate(plate_setup, extra_channels):
setup=apply_transform_czyx_setup(),
constant=st.integers(min_value=1, max_value=5),
)
@settings(max_examples=5, deadline=1200)
@settings(max_examples=5, deadline=None)
def test_apply_transform_to_zyx_and_save(setup, constant):
(
position_keys,
Expand Down Expand Up @@ -562,7 +562,7 @@ def test_apply_transform_to_zyx_and_save(setup, constant):
constant=st.integers(min_value=1, max_value=3),
num_processes=st.integers(min_value=1, max_value=3),
)
@settings(max_examples=3, deadline=2000)
@settings(max_examples=3, deadline=None)
def test_process_single_position(setup, constant, num_processes):
# def test_process_single_position(setup, constant, num_processes):
(
Expand Down

0 comments on commit 88623ea

Please sign in to comment.