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

Function test_constant

dask/array/tests/test_overlap.py:189–198  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

187
188
189def test_constant():
190 x = np.arange(64).reshape((8, 8))
191 d = da.from_array(x, chunks=(4, 4))
192
193 e = constant(d, axis=0, depth=2, value=10)
194 assert e.shape[0] == d.shape[0] + 4
195 assert e.shape[1] == d.shape[1]
196
197 assert_eq(e[1, :], np.ones(8, dtype=x.dtype) * 10)
198 assert_eq(e[-1, :], np.ones(8, dtype=x.dtype) * 10)
199
200
201def test_boundaries():

Callers

nothing calls this directly

Calls 5

constantFunction · 0.90
assert_eqFunction · 0.90
reshapeMethod · 0.80
arangeMethod · 0.45
onesMethod · 0.45

Tested by

no test coverage detected