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

Method test_async_sub_array

xarray/tests/test_indexing.py:596–604  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

594
595 @pytest.mark.asyncio
596 async def test_async_sub_array(self) -> None:
597 original = indexing.LazilyIndexedArray(np.arange(10))
598 wrapped = indexing.MemoryCachedArray(original)
599 child = wrapped[B[:5]]
600 assert isinstance(child, indexing.MemoryCachedArray)
601 await child.async_get_duck_array()
602 assert_array_equal(child, np.arange(5))
603 assert isinstance(child.array, indexing.NumpyIndexingAdapter)
604 assert isinstance(wrapped.array, indexing.LazilyIndexedArray)
605
606 def test_setitem(self) -> None:
607 original = np.arange(10)

Callers

nothing calls this directly

Calls 2

arangeMethod · 0.80
async_get_duck_arrayMethod · 0.45

Tested by

no test coverage detected