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

Function test_index_with_int_dask_array_nanchunks

dask/array/tests/test_slicing.py:674–680  ·  view source on GitHub ↗
(chunks)

Source from the content-addressed store, hash-verified

672
673@pytest.mark.parametrize("chunks", [1, 2, 3, 4, 5])
674def test_index_with_int_dask_array_nanchunks(chunks):
675 # Slice by array with nan-sized chunks
676 a = da.arange(-2, 3, chunks=chunks)
677 assert_eq(a[a.nonzero()], np.array([-2, -1, 1, 2]))
678 # Edge case: the nan-sized chunks resolve to size 0
679 a = da.zeros(5, chunks=chunks)
680 assert_eq(a[a.nonzero()], np.array([]))
681
682
683@pytest.mark.parametrize("chunks", [2, 4])

Callers

nothing calls this directly

Calls 4

assert_eqFunction · 0.90
nonzeroMethod · 0.80
arangeMethod · 0.45
zerosMethod · 0.45

Tested by

no test coverage detected