MCPcopy Create free account
hub / github.com/dask/dask / test_vindex_nd

Function test_vindex_nd

dask/array/tests/test_array_core.py:3464–3475  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3462
3463
3464def test_vindex_nd():
3465 x = np.arange(56).reshape((7, 8))
3466 d = da.from_array(x, chunks=(3, 4))
3467
3468 result = d.vindex[[[0, 1], [6, 0]], [[0, 1], [0, 7]]]
3469 assert_eq(result, x[[[0, 1], [6, 0]], [[0, 1], [0, 7]]])
3470
3471 result = d.vindex[np.arange(7)[:, None], np.arange(8)[None, :]]
3472 assert_eq(result, x)
3473
3474 result = d.vindex[np.arange(7)[None, :], np.arange(8)[:, None]]
3475 assert_eq(result, x.T)
3476
3477
3478@pytest.mark.parametrize("size", [0, 1])

Callers

nothing calls this directly

Calls 3

assert_eqFunction · 0.90
reshapeMethod · 0.80
arangeMethod · 0.45

Tested by

no test coverage detected