MCPcopy
hub / github.com/dask/dask / test_elemwise_with_ndarrays

Function test_elemwise_with_ndarrays

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

Source from the content-addressed store, hash-verified

1160
1161
1162def test_elemwise_with_ndarrays():
1163 x = np.arange(3)
1164 y = np.arange(12).reshape(4, 3)
1165 a = from_array(x, chunks=(3,))
1166 b = from_array(y, chunks=(2, 3))
1167
1168 assert_eq(x + a, 2 * x)
1169 assert_eq(a + x, 2 * x)
1170
1171 assert_eq(x + b, x + y)
1172 assert_eq(b + x, x + y)
1173 assert_eq(a + y, x + y)
1174 assert_eq(y + a, x + y)
1175 # Error on shape mismatch
1176 pytest.raises(ValueError, lambda: a + y.T)
1177 pytest.raises(ValueError, lambda: a + np.arange(2))
1178
1179
1180def test_elemwise_differently_chunked():

Callers

nothing calls this directly

Calls 4

from_arrayFunction · 0.90
assert_eqFunction · 0.90
reshapeMethod · 0.80
arangeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…