Skip to content

ValueError: No Zarr data type found that matches dtype 'dtype('uint32')' on Windows #3796

@radoering

Description

@radoering

Zarr version

3.15

Numcodecs version

0.14.1

Python Version

3.13

Operating System

Windows

Installation

using poetry into virtual environment

Description

On Windows, the following snippet, which worked with zarr 2, fails with zarr 3 with

ValueError: No Zarr data type found that matches dtype 'dtype('uint32')'

Repro:

import zarr

a = np.array([1, 2], dtype=np.uint32) & 1
zarr.array(a)

The issue seems to be that the dtype is UIntDtype instead of UInt32Dtype.

When running the following snippet:

dtypes = [
    (np.array([1, 2], dtype=np.uint16) & 1).dtype,
    (np.array([1, 2], dtype=np.uint32) & 1).dtype,
    (np.array([1, 2], dtype=np.uint64) & 1).dtype,
]
for dtype in dtypes:
    print(f"{dtype} {type(dtype)}")

we get

uint16 <class 'numpy.dtypes.UInt16DType'>
uint32 <class 'numpy.dtypes.UIntDtype'>
uint64 <class 'numpy.dtypes.UInt64DType'>

Steps to reproduce

import zarr

a = np.array([1, 2], dtype=np.uint32) & 1
zarr.array(a)

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