-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
arraydocumentationImprove or add to documentationImprove or add to documentationneeds attentionIt's been a while since this was pushed on. Needs attention from the owner or a maintainer.It's been a while since this was pushed on. Needs attention from the owner or a maintainer.
Description
The dask.array.coarsen documentation provides little detail about the requirements of its reduction argument:
Lines 87 to 88 in 6d639d2
| reduction: function | |
| Function like np.sum, np.mean, etc... |
Looking at the relevant part of the implementation:
Lines 133 to 136 in 6d639d2
| # (10, 10) -> (5, 2, 5, 2) | |
| newshape = tuple(concat([(x.shape[i] // axes[i], axes[i]) for i in range(x.ndim)])) | |
| return reduction(x.reshape(newshape), axis=tuple(range(1, x.ndim * 2, 2)), **kwargs) |
It seems to me that the requirements on the reduction function are:
- it should be able to take an array as the first argument, and
- it should be able to take in a tuple of axes as an
axis=argument, and - it should be able to not instantiate the input dask array (?). ie does the reduction function of np. only work because of
__array_function__dispatch? Or am I missing some other magic here?
Obviously I'm not super clear on the last one, or whether I'm missing some, and would love some guidance from people more familiar with this function, after which I'd be happy to make a PR or leave this as a good-first-issue for some dask hackathons. 😊
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
arraydocumentationImprove or add to documentationImprove or add to documentationneeds attentionIt's been a while since this was pushed on. Needs attention from the owner or a maintainer.It's been a while since this was pushed on. Needs attention from the owner or a maintainer.