MCPcopy
hub / github.com/pydata/xarray / async_to_duck_array

Function async_to_duck_array

xarray/namedarray/pycompat.py:150–161  ·  view source on GitHub ↗
(
    data: Any, **kwargs: dict[str, Any]
)

Source from the content-addressed store, hash-verified

148
149
150async def async_to_duck_array(
151 data: Any, **kwargs: dict[str, Any]
152) -> duckarray[_ShapeType, _DType]:
153 from xarray.core.indexing import (
154 ExplicitlyIndexed,
155 ImplicitToExplicitIndexingAdapter,
156 )
157
158 if isinstance(data, ExplicitlyIndexed | ImplicitToExplicitIndexingAdapter):
159 return await data.async_get_duck_array() # type: ignore[union-attr, no-any-return]
160 else:
161 return to_duck_array(data, **kwargs)

Callers 1

load_asyncMethod · 0.90

Calls 2

to_duck_arrayFunction · 0.85
async_get_duck_arrayMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…