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

Function test_arr_like_shape

dask/array/tests/test_creation.py:118–129  ·  view source on GitHub ↗
(funcname, kwargs, shape, dtype, chunks, out_shape)

Source from the content-addressed store, hash-verified

116)
117@pytest.mark.parametrize("dtype", ["i4"])
118def test_arr_like_shape(funcname, kwargs, shape, dtype, chunks, out_shape):
119 np_func = getattr(np, funcname)
120 da_func = getattr(da, funcname)
121 a = np.random.randint(0, 10, shape).astype(dtype)
122 np_r = np_func(a, shape=out_shape, **kwargs)
123 da_r = da_func(a, chunks=chunks, shape=out_shape, **kwargs)
124
125 assert np_r.shape == da_r.shape
126 assert np_r.dtype == da_r.dtype
127
128 if "empty" not in funcname:
129 assert_eq(np_r, da_r)
130
131
132@pytest.mark.parametrize("endpoint", [True, False])

Callers

nothing calls this directly

Calls 3

assert_eqFunction · 0.90
astypeMethod · 0.45
randintMethod · 0.45

Tested by

no test coverage detected