()
| 1160 | |
| 1161 | |
| 1162 | def 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 | |
| 1180 | def test_elemwise_differently_chunked(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…