Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Illviljan committed Oct 14, 2023
1 parent d126abc commit 8fe9828
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion xarray/namedarray/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,8 @@ def _nonzero(self: T_NamedArrayInteger) -> tuple[T_NamedArrayInteger, ...]:
nonzeros = np.nonzero(cast(NDArray[np.integer[Any]], self.data))
_attrs = self.attrs
return tuple(
_new(self, (dim,), nz, _attrs) for nz, dim in zip(nonzeros, self.dims)
(T_NamedArrayInteger, _new(self, (dim,), nz, _attrs))
for nz, dim in zip(nonzeros, self.dims)
)

def _as_sparse(
Expand Down
3 changes: 1 addition & 2 deletions xarray/tests/test_namedarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pytest

import xarray as xr
from xarray.namedarray._typing import _arrayfunction_or_api
from xarray.namedarray._typing import _arrayfunction_or_api, _ShapeType_co
from xarray.namedarray.core import NamedArray, from_array

if TYPE_CHECKING:
Expand All @@ -20,7 +20,6 @@
_DType_co,
_ScalarType,
_Shape,
_ShapeType_co,
duckarray,
)

Expand Down

0 comments on commit 8fe9828

Please sign in to comment.