pydata / pydata/xarray

Specify chunks in bytes

Open
#8,021 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement topic-dask
Dominant language
Python
Stars
4.2k
Forks
1.4k
Avg merge
2d 15h
Merged PRs (30d)
14

Description

Is your feature request related to a problem?

I'm playing around with xarray performance and would like a way to easily tweak chunk sizes. I'm able to do this by backing out what xarray chooses in an open_zarr call and then provide the right chunks= argument. I'll admit though that I wouldn't mind giving Xarray a value like "1 GiB" though and having it use that when determining "auto" chunk sizes.

Dask array does this in two ways. We can provide a value in chunks as like the following:

x = da.random.random(..., chunks="1 GiB")

We also refer to a value in Dask config

In [1]: import dask

In [2]: dask.config.get("array.chunk-size")
Out[2]: '128MiB'

This is not very important (I'm unblocked) but I thought I'd mention it in case someone is looking for some fun work 🙂

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing xarray's open_zarr chunks= handling and the auto chunk-size path, then compare the requested byte-size syntax with Dask array chunks and the dask.config array.chunk-size setting. Done means users can provide a value such as "1 GiB" when determining automatic chunk sizes, with coverage for the supported behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data, performance
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.