Skip to content

Complex dtypes lost when writing V2 arrays #2711

Closed
@martindurant

Description

@martindurant

Zarr version

3.0.1++

Numcodecs version

Python Version

3.12

Operating System

linux

Installation

manual from source

Description

Compound dtypes ("records") are allowed by numpy and worked in V2. They now loose their internal structure.

Steps to reproduce

The following passes on v2, not on v3

g = zarr.open(mode="w", zarr_version=2)
arr = g.create_array("name", dtype=[('a', "i8"), ('b', 'f8')], shape=(1, ), chunks=(1,), compressor=None, overwrite=True)
arr2 = g["name"]
assert arr2.dtype == [('a', '<i8'), ('b', '<f8')]

The v3 dtype comes back as dtype('V16').

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