Skip to content

Commit

Permalink
Update _set_functions.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Illviljan committed Sep 24, 2024
1 parent fe17279 commit 00115d1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions xarray/namedarray/_array_api/_set_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class UniqueInverseResult(NamedTuple):
def unique_all(x: NamedArray[Any, Any], /) -> UniqueAllResult:
xp = _get_data_namespace(x)
values, indices, inverse_indices, counts = xp.unique_all(x._data)
_dims = _atleast1d_dims(_flatten_dims(x.dims))
_dims = _flatten_dims(_atleast1d_dims(x.dims))
return UniqueAllResult(
NamedArray(_dims, values),
NamedArray(_dims, indices),
Expand Down Expand Up @@ -85,10 +85,9 @@ def unique_inverse(x: NamedArray[Any, Any], /) -> UniqueInverseResult:
"""
xp = _get_data_namespace(x)
values, inverse_indices = xp.unique_inverse(x._data)
_dims = _flatten_dims(_atleast1d_dims(x.dims))
return UniqueInverseResult(
NamedArray(_dims, values),
NamedArray(_dims, inverse_indices),
NamedArray(_flatten_dims(_atleast1d_dims(x.dims)), values),
NamedArray(_flatten_dims(x.dims), inverse_indices),
)


Expand Down

0 comments on commit 00115d1

Please sign in to comment.