Needs performance check / improvements in value assignment of DataArray
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.2k
- Forks
- 1.4k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 14
Description
In #1746, we added a validation in xr.DataArray.__setitem__ whether the coordinates consistency of array, key, and values are checked.
In the current implementation, we call xr.DataArray.__getitem__ to use the existing coordinate validation logic, but it does unnecessary indexing and it may decrease the __setitem__ performance if the arrray is multidimensional.
We may need to optimize the logic here.
Is it reasonable to constantly monitor the performance of basic operations, such as Dataset construction, alignment, indexing, and assignment?
(or are these operations too light to make a performance monitor?)
cc @jhamman @shoyer
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 with xarray/core/dataarray.py at lines 482-489 and read the setitem and getitem paths involved in coordinate validation. Check the effect of the current indexing on multidimensional assignments and review the discussion around issue #1746. Done means establishing whether the validation path can be made more efficient and assessing an appropriate performance check for the basic operation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data, performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100