zarr-developers / zarr-python

An implementation of chunked, compressed, N-dimensional arrays for Python.
https://zarr.readthedocs.io
MIT License
1.47k stars 273 forks source link

FSStore doesn't see array in an https-backed group #1568

Closed d-v-b closed 10 months ago

d-v-b commented 11 months ago

It seems that FSStore can access the following group, but does not find the array stored in the group. The array can be accessed directly, however.

import zarr
url = 'https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.4/idr0062A/6001240.zarr/'
group = zarr.open(zarr.storage.FSStore(url))
assert len(group.items()) == 0
array = zarr.open(zarr.storage.FSStore(url), path='0')
assert array.shape == (2, 236, 275, 271)

cc @martindurant

martindurant commented 11 months ago

Since HTTP can't really do file listing (except a few special cases derived from FTP), it can only be used with datasets that have consolidated metadata. Without [consolidated] metadata, zarr needs listing to know what arrays are contained in a group.

jhamman commented 11 months ago

@d-v-b - does this store have a consolidated metadata object (.zmetadata) at its root? Without it, it won't be able to list members.

edit: @martindurant beat me by 10 seconds. So fast!

d-v-b commented 11 months ago

yall are super fast! good to know re: consolidated metadata. This is a test dataset for ome-ngff, and the spec doesn't mention consolidated metadata, but it sounds like it should (as long as we want to use test data on http :) )

joshmoore commented 11 months ago

I'm very hesitant to mention consolidated metadata in OME-NGFF due to the lack of support in other Zarr implementations. I'm equally thrilled about having a ZEP for consolidated metadata in V3 so we can do exactly that!

martindurant commented 11 months ago

If you don't want to make a .zmetadata in the same location, you can put a kerchunk index anywhere else for the same effect :)

joshmoore commented 11 months ago

Same problem, same excitement.

d-v-b commented 10 months ago

I'm closing this, since the behavior I described is expected from the http store.