-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Dask Array's binops (__add__ etc) should delegate to __array_ufunc__. This issue is a follow up from #6632 (comment).
This kind of routing from binops to __array_ufunc__ is the recommended solution from NEP-13. Right now for example (arr is a Dask Array) np.add(arr, x) and arr + x uses slightly different code path, which introduces a chance for bugs, inconsistencies etc. To be clear, in the example above np.add(arr, x) is routing via NEP-13's __array_ufunc__, whilst arr + x is routing via python's __add__, and __add__ doesn't delegate to __array_ufunc__, which I would argue it should.
A solution to this would be to just implement the suggested NEP-13 routing via __array_ufunc__ and make sure that __array_ufunc__ properly handles delegations from binops.
Environment:
- Dask version: 2.27.0/master