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

Function test_copy_mutate

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

Source from the content-addressed store, hash-verified

3925
3926
3927def test_copy_mutate():
3928 x = da.arange(5, chunks=(2,))
3929 y = x.copy()
3930 memo = {}
3931 y2 = copy.deepcopy(x, memo=memo)
3932 x[x % 2 == 0] = -1
3933
3934 xx = np.arange(5)
3935 xx[xx % 2 == 0] = -1
3936 assert_eq(x, xx)
3937
3938 assert_eq(y, np.arange(5))
3939 assert_eq(y2, np.arange(5))
3940 assert memo[id(x)] is y2
3941
3942
3943def test_npartitions():

Callers

nothing calls this directly

Calls 3

assert_eqFunction · 0.90
arangeMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected