Skip to content

__array_ufunc__ for xarray #1617

Closed
@shoyer

Description

@shoyer

Now that __array_ufunc__ has appeared in NumPy 1.13, we should be able to resolve a long-standing annoyance with xarray: the inability to use NumPy ufuncs like np.sin() directly on all xarray objects, such as xarray.Dataset.

I believe this could be straightforwardly accomplished by wrapping xarray.core.computation.apply_ufunc.

Some care should be taken to ensure that properly defer to other array types, as suggested in the NEP. This also could be a good time to resolve some of the xarray's broader consistency issues when interacting with and wrapping other array-like types.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions