pydata / pydata/xarray

Add example of apply_ufunc + dask.array.map_blocks to docs?

Open
#6,585 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

What is your issue?

A pattern I use fairly often is apply_ufunc(..., dask="allowed") calling a function wrapped with dask.array.map_blocks. This is necessary to use apply_ufunc with chunked core dimensions.

AFAIK this currently isn't discussed anywhere in the docs. A sensible place to add a recipe explaining this would be just after this section in your notebook @dcherian ?

@rabernat @jbusecke this is the pattern we used in xGCM FYI

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 with the “Parallelization with dask” section in examples/apply_ufunc_vectorize_1d.html and review how the existing example is structured. Add a recipe explaining apply_ufunc(..., dask="allowed") calling a function wrapped with dask.array.map_blocks for chunked core dimensions; done means the pattern is documented in that location.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.