apply_raw() for a simpler version of apply_ufunc()
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.2k
- Forks
- 1.4k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 14
Description
apply_raw() would work like apply_ufunc(), but without the hard to understand broadcasting behavior and core dimensions.
The rule for apply_raw() would be that it directly unwraps its arguments and passes them on to the wrapped function, without any broadcasting. We would also include a dim argument that is automatically converted into the appropriate axis argument when calling the wrapped function.
Output dimensions would be determined from a simple rule of some sort:
- Default output dimensions would either be copied from the first argument, or would take on the ordered union on all input dimensions.
- Custom dimensions could either be set by adding a
drop_dimsargument (likedask.array.map_blocks), or require an explicit overrideoutput_dims.
This also could be suitable for defining as a method instead of a separate function. See https://github.com/pydata/xarray/issues/1251 and https://github.com/pydata/xarray/issues/1130 for related issues.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing apply_ufunc() entry point and related issues #1251 and #1130. The work is done when the apply_raw() API, its dim-to-axis behavior, and a single output-dimension rule are agreed and implemented; the issue currently leaves those design choices open.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100