Skip to content

Commit

Permalink
Update _utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Illviljan committed Aug 25, 2024
1 parent 45abdfd commit d3efb66
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 @@ -9,6 +9,7 @@
_arrayapi,
_Axis,
_AxisLike,
_Axes,
_default,
_Dim,
_Dims,
Expand Down Expand Up @@ -103,7 +104,7 @@ def _assert_either_dim_or_axis(

def _dims_to_axis(
x: NamedArray[Any, Any], dims: _Dim | _Dims | Default, axis: _AxisLike | None
) -> _AxisLike | None:
) -> _Axes | None:
"""
Convert dims to axis indices.
Expand All @@ -112,7 +113,7 @@ def _dims_to_axis(
>>> narr = NamedArray(("x", "y"), np.array([[1, 2, 3], [5, 6, 7]]))
>>> _dims_to_axis(narr, ("y",), None)
(1,)
>>> _dims_to_axis(narr, None, 0)
>>> _dims_to_axis(narr, _default, 0)
(0,)
>>> _dims_to_axis(narr, None, None)
"""
Expand Down

0 comments on commit d3efb66

Please sign in to comment.