Skip to content

Conversation

aha66
Copy link

@aha66 aha66 commented Apr 4, 2021

  • [x ] Tests added

@dcherian
Copy link
Contributor

dcherian commented Apr 5, 2021

Thanks @aha66

You can get what you want by specifying exclude_dims so I am not sure this change is needed:

variable = xr.DataArray(np.arange(10), dims=["x"])


def func(a):
    return ()


xr.apply_ufunc(func, variable, input_core_dims=[["x"]], exclude_dims={"x"})
<xarray.DataArray ()>
array((), dtype=object)

A PR to improve the documentation would be very welcome.

@max-sixty
Copy link
Collaborator

@aha66 does @dcherian 's suggestion resolve this?

@dcherian
Copy link
Contributor

@aha66 please reopen if my suggestion doesn't work for you. Thanks!

@dcherian dcherian closed this May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants