MCPcopy Index your code
hub / github.com/pydata/xarray / _get_axis_num

Method _get_axis_num

xarray/namedarray/core.py:696–703  ·  view source on GitHub ↗
(self: Any, dim: Hashable)

Source from the content-addressed store, hash-verified

694 return self._get_axis_num(dim)
695
696 def _get_axis_num(self: Any, dim: Hashable) -> int:
697 _raise_if_any_duplicate_dimensions(self.dims)
698 try:
699 return self.dims.index(dim) # type: ignore[no-any-return]
700 except ValueError as err:
701 raise ValueError(
702 f"{dim!r} not found in array dimensions {self.dims!r}"
703 ) from err
704
705 @property
706 def chunks(self) -> _Chunks | None:

Callers 1

get_axis_numMethod · 0.95

Calls 2

indexMethod · 0.45

Tested by

no test coverage detected