Skip to content

Commit

Permalink
typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Illviljan committed Sep 25, 2024
1 parent 0f26d51 commit 2cec2c7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions xarray/namedarray/_array_api/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ def _atleast1d_dims(dims: _Dims) -> _Dims:
return (_new_unique_dim_name(dims),) if len(dims) < 1 else dims


def _reduce_dims(dims: _Dims, *, axis: _AxisLike | None, keepdims: False) -> _Dims:
def _reduce_dims(dims: _Dims, *, axis: _AxisLike | None, keepdims: bool) -> _Dims:
"""
Reduce dims according to axis.
Expand All @@ -524,7 +524,8 @@ def _reduce_dims(dims: _Dims, *, axis: _AxisLike | None, keepdims: False) -> _Di
else:
_axis = _normalize_axis_tuple(axis, ndim)

key = [slice(None)] * ndim
k: _IndexKeys = (slice(None),) * ndim
key = list(k)
for i, v in enumerate(_axis):
key[v] = 0

Expand Down

0 comments on commit 2cec2c7

Please sign in to comment.