-
-
Notifications
You must be signed in to change notification settings - Fork 378
Closed
Labels
bugPotential issues with the zarr-python libraryPotential issues with the zarr-python library
Description
Zarr version
2.13.6
Numcodecs version
0.11.0
Python Version
3.10.9, any version
Operating System
Windows
Installation
pip
Description
Fsspec ReferenceFileSystem files for image file sequences produced by tifffile can no longer be read correctly by zarr 2.13.6. Version 2.13.3 worked fine.
Tifffile's test_tifffile::test_write_fsspec_sequence and earthbigdata.py fail with zarr 2.13.6.
It looks like the chunks are no longer correctly mapped to their indices.
Steps to reproduce
Example
import tifffile
import fsspec
import zarr
from tifffile.numcodecs import register_codec
register_codec()
print(f'tifffile {tifffile.__version__}')
print(f'fsspec {fsspec.__version__}')
print(f'zarr {zarr.__version__}')
# generate file sequence
for i in range(16):
for j in range(16):
tifffile.imwrite(f'test_{i}_{j}.tif', [i * j])
expected = tifffile.imread('*.tif', pattern=r'_(\d+)_(\d+)')
# write fsspec ReferenceFileSystem file
with tifffile.imread('*.tif', pattern=r'_(\d+)_(\d+)', aszarr=True) as store:
store.write_fsspec('test.json', '')
# get zarr array from reference file
mapper = fsspec.get_mapper('reference://', fo='test.json', target_protocol='file')
from_zarr = zarr.open(mapper, mode='r')[:]
# compare images
from matplotlib import pyplot
pyplot.subplot(211)
pyplot.imshow(expected)
pyplot.subplot(212)
pyplot.imshow(from_zarr)
pyplot.show()Output
tifffile 2022.10.10
fsspec 2022.11.0
zarr 2.13.6
Additional output
Metadata
Metadata
Assignees
Labels
bugPotential issues with the zarr-python libraryPotential issues with the zarr-python library
