-
Notifications
You must be signed in to change notification settings - Fork 65
Zarr v3 #404
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
Zarr v3 #404
Conversation
Fixes TypeError: Unsupported type for store_like: 'LocalPath'
for more information, see https://pre-commit.ci
|
Zarr v3 is not supported on python 3.9 or 3.10. I'll remove them from the build... Build on python 3.12 is failing tests with: |
|
This pull request has been mentioned on Image.sc Forum. There might be relevant details there: https://forum.image.sc/t/ome-zarr-py-development-status/104671/4 |
|
@will-moore: what's the next step here? |
|
@joshmoore: With those changes, you now are forced to specify That code works, but unfortunately we end up with data that looks like After testing a matrix of using different versions for Testing the same matrix of versions with released ome-zarr-py produces all valid output except when you use To summarise, we probably ALSO want to prevent usage of So users must then do: Does this look acceptable? |
|
Sorry for chiming in after only superficially following; my opinion might be naive, but:
For me, this screams for an object-oriented API where I can get some |
|
Thanks for the suggestion @imagejan. This certainly seems quite painful to ask for the format twice, especially since it's not really used in So, let's move the version checking to Then we can just do: |
|
👍 for the update
Not sure how much of your questions hold, but I'd say Yes!. Let's favor breaking the API over breaking data. |
|
With zarr v3.0.8, and this current PR, I was testing the docs examples, e.g. for adding Actually, that fails in zarr v2 - you can't create a group where one exists already. Should have tested that better! However, in Zarr v3 with this branch, when you do this: it completely replaces EVERYTHING at I'll fix the docs for the released version, but I wonder if we should add checks in to |
Definitely. Do you think there's a lingering bug in zarr-python or more just a surprise? |
|
This is what we're doing under EDIT: |
Tests all pass without this, and I have found that this can swallow useful Exceptions. It's never useful to return None since then we just get a less useful Exception later
|
@joshmoore (and others): I think I'm done with those changes now, fixed the |
|
Over at https://imagesc.zulipchat.com/#narrow/channel/328251-NGFF/topic/.E2.9C.94.20Non.20web-based.20viewers.20for.20v0.2E5.20stores/near/520091410 "[this] PR worked right away on a ~1TB v0.5 store". With |
|
I tested this in a typical napari 0.6.1 environment with tifffile, napari-tiff, zarr3 (for local whole-slide) and napari-ome-zarr (for remote). Everything as compatible, so no install issues. |
|
I was looking at the next step of support for writing OME-Zarr v0.5 (zarr v3) over at #413 (comment) and ran into issues with mixing of zarr v2 and zarr v3. To summarise, when writing OME-Zarr, I think it will work better to specify the version when you create the store with So I'm going to go ahead and give that a try. Apologies for the back and forth on this.... |
This updates ome-zarr-py to use zarr-python v3 but doesn't include support for writing Zarr v3 (OME-Zarr v0.5).
However, it does add support for reading OME-Zarr v0.5 (e.g. for use by napari-ome-zarr).
To test:
Install from this branch:
$ cd ome-zarr-py && pip install -e .and update zarr to v3.0.8$ pip install -U zarr.See the changes in
docs/source/python.rstfor changes needed for writing methods (need to specify v0.4 since we don't support writing the latest OME-Zarr v0.5 version).Try reading v0.5 data in napari:
$ pip install napari-ome-zarrThen try various v0.5 examples from e.g. https://idr.github.io/ome-ngff-samples/ or https://ome.github.io/ome2024-ngff-challenge/ (click on thumbnail and copy the
urlfield in the popup. NB: if the image isbioformats2rawlayout, you'll need to add/0to the zarr url. If in doubt, open in Validator first.Most of the IDR samples there are plates. E.g:
In several places I've hard-coded
zarr_version=2. This works because you can dozarr.open_group(store=self.__store, path="/", zarr_version=2)inparse_url()to create a group to write into, or find a group to read from without specifying whether you expect the group to already exist.Without the
zarr_version=2, zarr will createzarr.jsonif the mode of the store isw.NB: I have another PR (in progress) to add support for writing OME-Zarr v0.5 at #413