dask-awkward
dask-awkward copied to clipboard
Add __array_function__ to dispatch NumPy funcs to dask-awkward
Add NumPy function dispatching to dask-awkward
This PR adds an array_function method to the Array class, allowing NumPy functions to be automatically redirected to their dask-awkward counterparts. It covers 38 common functions, making it easier to use NumPy-style operations with dask-awkward arrays.
I'd be a bit careful with this kind of dispatch. The numpy functions can have subtly different behaviors from their awkward counterparts. This mapping isn't very well defined for the arbitrary numpy functions (but is for ufuncs).
It would almost be better to suggest converting to dask.array and error out since there the expected behavior is much more clear.