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

Method check_vectorized_indexing

xarray/tests/test_variable.py:2969–2979  ·  view source on GitHub ↗
(self, v, load_async)

Source from the content-addressed store, hash-verified

2967 assert np.allclose(result, expected)
2968
2969 async def check_vectorized_indexing(self, v, load_async):
2970 ind_x = Variable("z", [0, 2])
2971 ind_y = Variable("z", [2, 1])
2972 expected = self.d[ind_x, ind_y]
2973
2974 if load_async:
2975 result = await v.isel(x=ind_x, y=ind_y).load_async()
2976 else:
2977 result = v.isel(x=ind_x, y=ind_y).load()
2978
2979 assert np.allclose(result, expected)
2980
2981 @pytest.mark.asyncio
2982 @pytest.mark.parametrize("load_async", [True, False])

Callers 5

test_CopyOnWriteArrayMethod · 0.95

Calls 4

VariableClass · 0.90
load_asyncMethod · 0.45
iselMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected