Skip to content

Conversation

@will-moore
Copy link
Member

@will-moore will-moore commented Aug 18, 2025

Fixes #471.

TODO: fix lots of tests!

We should also consider handling the scenario described there, where user expects one OME-Zarr format but gets a different one.

See #468 where we remove handling of mismatching ome-zarr formats, because we don't want to re-create a store.

probably parse_url() with No format specified should be happy to read any format, but IF you specify a format, it MUST match.
This would be similar to the strategy used for write_image() etc where the default format is None (format will be chosen based on zarr group) but if you specify a format that is incompatible, you get an exception.

e.g.

    def test_wrong_format(self):
        """ Write a v0.4 zarr, read it as CurrentFormat"""
        grp = create_zarr(str(self.path), fmt=FormatV04())
        # should use correct format
        v2reader = Reader(parse_url(str(self.path)))
        # should raise exception
        reader = Reader(parse_url(str(self.path), fmt=CurrentFormat()))
        assert len(list(reader())) == 0

@will-moore
Copy link
Member Author

Closing in favour of #476

@will-moore will-moore closed this Sep 5, 2025
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.

Could be useful if io.parse_url raises an Exception instead of returning None

1 participant