Skip to content

N5Store wrong behavior - dtype #1339

@mzouink

Description

@mzouink

Zarr version

v2.13.3

Numcodecs version

v0.11.0

Python Version

3.8

Operating System

Mac

Installation

using conda

Description

N5Store is exposing N5 data as Zarr.
When asking for ".zarray" the store convert the key to "attributes.json". then, read the file and convert the meta key and values to Zarr conventions. but for data type it is kept as numpy dtype ("uint8") which should be dtype.str ("|u1")

The problem is solved by Array. But when i want to expose the store to other service i get bugs.
@d-v-b

Steps to reproduce

import json
import zarr
from zarr.n5 import N5FSStore
from zarr.storage import MemoryStore

n5_store = N5FSStore('/tmp/test_n5')
z = zarr.open(n5_store)
z.create_dataset("test", shape=(1000, 1000, 10), dtype="u1")

print(json.loads(zarr_store["test/.zarray"])["dtype"])

zarr_store = MemoryStore()
z = zarr.open(zarr_store)
z.create_dataset("test", shape=(1000, 1000, 10), dtype="u1")

print(json.loads(n5_store["test/.zarray"])["dtype"])

Additional output

uint8
|u1

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