Skip to content

[v3] zarr 3 fails to create child groups #2228

Closed
@jhamman

Description

@jhamman

Zarr version

3.0.0.alpha5

Numcodecs version

NA

Python Version

3.11

Operating System

Mac

Installation

pip

Description

The v3 branch is missing some important behavior around the implicit creation of sub-nodes. In 2.x, this behavior existed:

In [1]: import zarr

In [2]: store = {}

In [3]: zarr.create(shape=(10, 10), store=store, path='foo/bar/spam')
Out[3]: <zarr.core.Array '/foo/bar/spam' (10, 10) float64>

In [4]: list(store)
Out[4]: ['.zgroup', 'foo/.zgroup', 'foo/bar/.zgroup', 'foo/bar/spam/.zarray']

In [5]: g = zarr.open_group(store=store)

In [6]: g
Out[6]: <zarr.hierarchy.Group '/'>

Note the creation of sub groups foo, foo.bar, and foo.bar.spam.

Steps to reproduce

In [1]: import zarr

In [2]: store = await zarr.store.MemoryStore.open(mode='w')

In [3]: zarr.create(shape=(10, 10), store=store, path='foo/bar/spam')
Out[3]: <Array memory://4841759424/foo/bar/spam shape=(10, 10) dtype=float64>

In [4]: list(store._store_dict)
Out[4]: ['foo/bar/spam/zarr.json']

Note that zarr failed to create zarr.json objects for any of the parent groups.

Additional output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugPotential issues with the zarr-python library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions