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

Function test_boolean_numpy_array_slicing

dask/array/tests/test_slicing.py:495–505  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

493
494
495def test_boolean_numpy_array_slicing():
496 with pytest.raises(IndexError):
497 da.asarray(range(2))[np.array([True])]
498 with pytest.raises(IndexError):
499 da.asarray(range(2))[np.array([False, False, False])]
500 x = np.arange(5)
501 ind = np.array([True, False, False, False, True])
502 assert_eq(da.asarray(x)[ind], x[ind])
503 # https://github.com/dask/dask/issues/3706
504 ind = np.array([True])
505 assert_eq(da.asarray([0])[ind], np.arange(1)[ind])
506
507
508def test_empty_list():

Callers

nothing calls this directly

Calls 2

assert_eqFunction · 0.90
arangeMethod · 0.45

Tested by

no test coverage detected