Skip to content

After #516 zarr triggers a validation error for certain chunks formats #560

@LucaMarconato

Description

@LucaMarconato

Reporting an issue that was reported in spatialdata here: scverse/spatialdata#1090.

In short, this PR https://github.com/ome/ome-zarr-py/pull/516/changes#diff-d51ad4cb28d657d5e09c58f40674b95273611983353ab5d7bb2049bbc6303f7b introduces this line of code (appearing first in 0.14.0)

zarr_array_kwargs["chunks"] = chunks_opt

Until 0.13.0, chunk was only used in .rechunk

image = da.array(image).rechunk(chunks=chunks_opt)
and therefore chunks that are valid for dask, such as ((3,), (512,), (512,)), would have been correctly handled. Now that chunks is passed all the way down to zarr, we get a validation error for values of chunks that are not flat (in the case above, zarr expects (3, 512, 512), not the tuple of tuples format).

Since in spatialdata we have control of which format for chunks we pass to ome-zarr-py, I will implement a fix there. I nevertheless report as this problem may affect other developers.

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