()
| 493 | |
| 494 | |
| 495 | def 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 | |
| 508 | def test_empty_list(): |