Skip to content

wrong chunk sizes in html repr with nonuniform chunks #4376

Description

@dcherian

What happened:

The HTML repr is using the first element in a chunks tuple;

What you expected to happen:

it should be using whatever dask does in this case

Minimal Complete Verifiable Example:

import xarray as xr
import dask


test = xr.DataArray(
    dask.array.zeros(
        (12, 901, 1001),
        chunks=(
            (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
            (1, 899, 1),
            (1, 199, 1, 199, 1, 199, 1, 199, 1, 199, 1),
        ),
    )
)
test.to_dataset(name="a")

image

EDIT: The text repr has the same issue

<xarray.Dataset>
Dimensions:  (dim_0: 12, dim_1: 901, dim_2: 1001)
Dimensions without coordinates: dim_0, dim_1, dim_2
Data variables:
    a        (dim_0, dim_1, dim_2) float64 dask.array<chunksize=(1, 1, 1), meta=np.ndarray>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions