Skip to content

zarr 2.10.0 fails to load pre-existing nested files #840

Closed

Description

@abred

Minimal, reproducible code sample, a copy-pastable example if possible

import numpy as np
import zarr
a = np.ones((2,2)) 
z = zarr.open(zarr.NestedDirectoryStore("test.zarr"), 'w')
z['test'] = a

z = zarr.open(zarr.NestedDirectoryStore("test.zarr"), 'r')
print(np.array(z['test']))

arr = zarr.open(zarr.NestedDirectoryStore("path/to/existing/zarr/file.zarr"), 'r')
print(np.max(arr['volumes/raw']))

output with zarr 2.10.0:
array([[1., 1.],
[1., 1.]])
0

output with zarr 2.3.0:
array([[1., 1.],
[1., 1.]])
6733

Problem description

With the current version of zarr (2.10.0) pre-existing zarr files using NestedDirectoryStore are all zero when read.
With an older version (tested with 2.3.0) the correct values are loaded.
Creating a new zarr file using NestedDirectoryStore on 2.10.0 and reading it works correctly.

Version and installation information

Please provide the following:

  • Value of zarr.__version__: '2.10.0'
  • Value of numcodecs.__version__: '0.9.1'
  • Version of Python interpreter: 3.8.11
  • Operating system (Linux/Windows/Mac): Linux
  • How Zarr was installed (e.g., "using pip into virtual environment", or "using conda"): pip install

Activity

  1. joshmoore commented on Oct 6, 2021

    @joshmoore
    Member

    Hi @abred. My apologies. I look at this almost every morning and think, "I need to write a test for this" but keep failing to do so. Is there any chance of your uploading something that will reproduce the error (e.g. by adding a very small dataset to the fixtures/ directory). I don't think the error will be hard to debug once we can see it happening.

  2. added 2 commits that reference this issue on Oct 18, 2021
    c36ec3d
    a35a1a5
  3. joshmoore commented on Oct 18, 2021

    @joshmoore
    Member

    I'm managed to reproduce. Please see #850

  4. added a commit that references this issue on Oct 19, 2021
    d1dc987
  5. joshmoore commented on Oct 19, 2021

    @joshmoore
    Member

    @abred : please let us know if the issues persist.

  6. abred commented on Oct 21, 2021

    @abred
    Author

    Thank you for fixing this! And sorry for not getting back to you in time, I was on vacation. It's working now.

  7. joshmoore commented on Oct 21, 2021

    @joshmoore
    Member

    👍 Thanks for letting us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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