Skip to content

Error creating ArraySpec from array without dimension names #107

@dstansby

Description

@dstansby
import zarr

from pydantic_zarr.v3 import ArraySpec

ArraySpec.from_array(zarr.empty((1, 1, 1)))
Traceback (most recent call last):
  File "/Users/dstansby/software/zarr/pydantic-zarr/test.py", line 4, in <module>
    ArraySpec.from_array(zarr.empty((1, 1, 1)))
  File "/Users/dstansby/software/zarr/pydantic-zarr/src/pydantic_zarr/v3.py", line 316, in from_array
    dimension_names_actual = auto_dimension_names(array)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dstansby/software/zarr/pydantic-zarr/src/pydantic_zarr/v3.py", line 1049, in auto_dimension_names
    return tuple(data.metadata.dimension_names)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions