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

Method async_get_duck_array

xarray/core/indexing.py:853–862  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

851 return _wrap_numpy_scalars(array)
852
853 async def async_get_duck_array(self):
854 from xarray.backends.common import BackendArray
855
856 if isinstance(self.array, BackendArray):
857 array = await self.array.async_getitem(self.key)
858 else:
859 array = apply_indexer(self.array, self.key)
860 if isinstance(array, ExplicitlyIndexed):
861 array = await array.async_get_duck_array()
862 return _wrap_numpy_scalars(array)
863
864 def _updated_key(self, new_key: ExplicitIndexer):
865 return _combine_indexers(self.key, self.shape, new_key)

Callers

nothing calls this directly

Calls 4

apply_indexerFunction · 0.90
_wrap_numpy_scalarsFunction · 0.85
async_getitemMethod · 0.45
async_get_duck_arrayMethod · 0.45

Tested by

no test coverage detected