Skip to content

Fails to open Zarr v0.4+ #655

@chourroutm

Description

@chourroutm

This website lists open access Zarr and OME-Zarr datasets: https://idr.github.io/ome-ngff-samples/

I have tried to open these two files:

import cloudvolume

url = "zarr://https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.4/idr0048A/9846152.zarr/"
url = "zarr://https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.5/idr0066/ExpA_VIP_ASLM_on.zarr/"

vol = cloudvolume.CloudVolume(url, parallel=True, progress=True, use_https=True)

print(vol.shape)

The first file gives the following error:

Traceback (most recent call last):
File "/home/ucemm12/test_repos/cloud-volume-zarr/test_public_zarr.py", line 6, in
vol = cloudvolume.CloudVolume(url, parallel=True, progress=True, use_https=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ucemm12/test_repos/cloud-volume-zarr/.venv/lib/python3.12/site-packages/cloudvolume/cloudvolume.py", line 250, in new
return init(cloudpath)
^^^^^^^^^^^^^^^
File "/home/ucemm12/test_repos/cloud-volume-zarr/.venv/lib/python3.12/site-packages/cloudvolume/cloudvolume.py", line 243, in init
return REGISTERED_PLUGINSpath.format
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ucemm12/test_repos/cloud-volume-zarr/.venv/lib/python3.12/site-packages/cloudvolume/datasource/zarr/init.py", line 47, in create_zarr
meta = ZarrMetadata(cloudpath, config=config, cache=cache, info=info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ucemm12/test_repos/cloud-volume-zarr/.venv/lib/python3.12/site-packages/cloudvolume/datasource/zarr/metadata.py", line 50, in init
self.info = self.fetch_info()
^^^^^^^^^^^^^^^^^
File "/home/ucemm12/test_repos/cloud-volume-zarr/.venv/lib/python3.12/site-packages/cloudvolume/datasource/zarr/metadata.py", line 471, in fetch_info
return self.zarr_to_info(self.zarrays, self.zattrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ucemm12/test_repos/cloud-volume-zarr/.venv/lib/python3.12/site-packages/cloudvolume/datasource/zarr/metadata.py", line 399, in zarr_to_info
base_res = self.spatial_resolution_in_nm(0, zattrs, zarrays)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ucemm12/test_repos/cloud-volume-zarr/.venv/lib/python3.12/site-packages/cloudvolume/datasource/zarr/metadata.py", line 133, in spatial_resolution_in_nm
scale_factors[2] = unit2factor(axis["unit"])
~~~~^^^^^^^^
KeyError: 'unit'

And the second one:

Traceback (most recent call last):
File "/home/ucemm12/test_repos/cloud-volume-zarr/test_public_zarr.py", line 6, in
vol = cloudvolume.CloudVolume(url, parallel=True, progress=True, use_https=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ucemm12/test_repos/cloud-volume-zarr/.venv/lib/python3.12/site-packages/cloudvolume/cloudvolume.py", line 258, in new
raise err
File "/home/ucemm12/test_repos/cloud-volume-zarr/.venv/lib/python3.12/site-packages/cloudvolume/cloudvolume.py", line 250, in new
return init(cloudpath)
^^^^^^^^^^^^^^^
File "/home/ucemm12/test_repos/cloud-volume-zarr/.venv/lib/python3.12/site-packages/cloudvolume/cloudvolume.py", line 243, in init
return REGISTERED_PLUGINSpath.format
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ucemm12/test_repos/cloud-volume-zarr/.venv/lib/python3.12/site-packages/cloudvolume/datasource/zarr/init.py", line 47, in create_zarr
meta = ZarrMetadata(cloudpath, config=config, cache=cache, info=info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ucemm12/test_repos/cloud-volume-zarr/.venv/lib/python3.12/site-packages/cloudvolume/datasource/zarr/metadata.py", line 50, in init
self.info = self.fetch_info()
^^^^^^^^^^^^^^^^^
File "/home/ucemm12/test_repos/cloud-volume-zarr/.venv/lib/python3.12/site-packages/cloudvolume/datasource/zarr/metadata.py", line 471, in fetch_info
return self.zarr_to_info(self.zarrays, self.zattrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ucemm12/test_repos/cloud-volume-zarr/.venv/lib/python3.12/site-packages/cloudvolume/datasource/zarr/metadata.py", line 397, in zarr_to_info
raise exceptions.InfoUnavailableError()
cloudvolume.exceptions.InfoUnavailableError

Maybe related to #651?

Note that it worked on a Google Cloud Storage bucket where I have private data as OME-Zarr.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThe code is not performing according to the design or a design flaw is seriously impacting users.zarrzarr format related.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions