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

Method __array__

xarray/core/indexing.py:682–688  ·  view source on GitHub ↗
(
        self, dtype: DTypeLike | None = None, /, *, copy: bool | None = None
    )

Source from the content-addressed store, hash-verified

680 self.indexer_cls = indexer_cls
681
682 def __array__(
683 self, dtype: DTypeLike | None = None, /, *, copy: bool | None = None
684 ) -> np.ndarray:
685 if Version(np.__version__) >= Version("2.0.0"):
686 return np.asarray(self.get_duck_array(), dtype=dtype, copy=copy)
687 else:
688 return np.asarray(self.get_duck_array(), dtype=dtype)
689
690 def get_duck_array(self):
691 return self.array.get_duck_array()

Callers

nothing calls this directly

Calls 1

get_duck_arrayMethod · 0.95

Tested by

no test coverage detected