Skip to content

zarr.open_array does not properly recognize NestedDirectoryStore #530

@JimBiardCics

Description

@JimBiardCics
import numpy
import zarr

a = zarr.create((10, 100, 100), chunks = (1, 100, 100), dtype = 'f4',
                store = zarr.NestedDirectoryStore('foo.zarr'), overwrite = True)

a[...] = 1.0

print('shape =', a.shape)
print('a has non-zero values =', numpy.any(a))

del a

a = zarr.open_array('foo.zarr', mode = 'r')

print('shape =', a.shape)
print('a has non-zero values =', numpy.any(a))

Problem description

A zarr 'file' created using NestedDirectoryStore will not load correctly when later opened using the path alone. The shape (and other metadata) is correct, but the values are not loaded. In the code sample above, the shape of the original and reloaded array is the same, but the contents don't match. The second array contains only zeroes.

Version and installation information

  • Value of zarr.__version__ - 2.3.2
  • Value of numcodecs.__version__ - 0.6.4
  • Version of Python interpreter - 3.6.7 (anaconda)
  • Operating system (Linux/Windows/Mac) - Mac OS Mojave (10.14.6)
  • How Zarr was installed - using conda

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions