Skip to content

Add blockwise example with ragged size outputs - #7551

Closed
GenevieveBuckley wants to merge 2 commits into
dask:mainfrom
GenevieveBuckley:ragged-blockwise-example
Closed

GenevieveBuckley wants to merge 2 commits into
dask:mainfrom
GenevieveBuckley:ragged-blockwise-example

Conversation

@GenevieveBuckley

Copy link
Copy Markdown
Contributor

There aren't many examples of doing something to chunks of a dask array with a function that returns ragged size outputs. This example could help with that.

  • Tests added / passed
  • Passes black dask / flake8 dask / isort dask

@github-actions github-actions Bot added the array label Apr 13, 2021
@GenevieveBuckley

Copy link
Copy Markdown
Contributor Author

Maybe this isn't a good example after all. Or, maybe I'm doing something silly when I try to extend this ragged example to 2D input chunks. Can someone anyone give me a hint for what I'd do for this kind of input?

x2 = da.from_array(np.random.randint(0, 3, size=(6, 9)), chunks=(3, 3))

My task graphs don't seem to have an independent task per chunk, which is why I think I'm doing something wrong.

I've tried adding .ravel() to the block input inside my greater_than_zero function, as well as trying to dump the output in a new axis with new_axes={'z': np.nan}`

@GenevieveBuckley

Copy link
Copy Markdown
Contributor Author

I think this is a bad example, I can't show it generalizing well to ND arrays with multiple chunks along each dimension. (I'm not saying that can't be done, just that I haven't shown it well & so I think on balance it's better not to include in the docs)

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant