Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix well naming case mismatch bug #254

Merged
merged 7 commits into from
Oct 2, 2024
Merged

Fix well naming case mismatch bug #254

merged 7 commits into from
Oct 2, 2024

Conversation

ieivanov
Copy link
Contributor

@ieivanov ieivanov commented Oct 1, 2024

Skips test_combine_fovs_to_hcs, see #255

Copy link
Contributor

@talonchandler talonchandler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Added a couple simple tests for case insensitivity.

@talonchandler
Copy link
Contributor

talonchandler commented Oct 2, 2024

Hmmm, this might be a genuine error.

    def test_create_position_case_sensitivity():
        """Test `iohub.ngff.Plate.create_position()`"""
        with TemporaryDirectory() as temp_dir:
            store_path = os.path.join(temp_dir, "hcs.zarr")
            dataset = open_ome_zarr(
                store_path, layout="hcs", mode="a", channel_names=["GFP"]
            )
            dataset.create_position("S", "0", "1")
>           dataset.create_position("s", "1", "0")

tests/ngff/test_ngff.py:680: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
iohub/ngff/nodes.py:1614: in create_position
    well = self.create_well(
iohub/ngff/nodes.py:1565: in create_well
    row_grp = self[row_name].zgroup
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <iohub.ngff.nodes.Plate object at 0x7fc8cf0ed1b0>, key = 's'

    def __getitem__(self, key):
        key = normalize_storage_path(key)
        znode = self.zgroup.get(key)
        if not znode:
>           raise KeyError(key)
E           KeyError: 's'

Looking closer...passes on the HPC FWIW.

Edt: passing on mac, but not HPC

Copy link
Contributor

@talonchandler talonchandler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix linux tests

Copy link
Contributor

@talonchandler talonchandler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted my tests, so that tests are not blocking. Approving, and we'll leave the issue open.

@ieivanov ieivanov merged commit 88623ea into main Oct 2, 2024
7 checks passed
@ieivanov ieivanov deleted the fix_well_naming_case branch October 2, 2024 21:50
@@ -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]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I consider this a bug if a key in node is True does not guarantee that node[key] succeeds on all platforms.

@ziw-liu
Copy link
Collaborator

ziw-liu commented Oct 7, 2024

Is this PR intended to just modify test or also to modify library behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

create_position fails when inconsistent row/column capitalization is used
3 participants