You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MemoryStore.list_dir incorrectly includes an entry for each nested child of a group. This differs from the behavior of LocalStore.list_dir
Steps to reproduce
This program sets up a store with some nested objects:
import zarr.store
import zarr.core.buffer
async def main():
local = zarr.store.LocalStore("/tmp/foo", mode="w")
mem = zarr.store.MemoryStore({}, mode="w")
paths = [
'root/a0/zarr.json',
'root/g0/zarr.json',
'root/g0/a1/zarr.json',
'root/g0/g1/zarr.json',
'root/g0/g1/a2/zarr.json',
'root/g0/g1/g2/zarr.json',
]
for store in [local, mem]:
for path in paths:
await store.set(path, zarr.core.buffer.Buffer.from_bytes(b""))
print(type(store).__name__)
print([x async for x in store.list_dir("root")])
print("-" * 80)
if __name__ == "__main__":
import asyncio
asyncio.run(main())
Zarr version
v3
Numcodecs version
n/a
Python Version
n/a
Operating System
n/a
Installation
n/a
Description
MemoryStore.list_dir incorrectly includes an entry for each nested child of a group. This differs from the behavior of LocalStore.list_dir
Steps to reproduce
This program sets up a store with some nested objects:
Here's the output:
The
g0
group is repeated once per child.Additional output
I'll have a PR shortly.
The text was updated successfully, but these errors were encountered: