()
| 3216 | |
| 3217 | |
| 3218 | def test_map_blocks3(): |
| 3219 | x = np.arange(10) |
| 3220 | y = np.arange(10) * 2 |
| 3221 | |
| 3222 | d = da.from_array(x, chunks=5) |
| 3223 | e = da.from_array(y, chunks=5) |
| 3224 | |
| 3225 | assert_eq( |
| 3226 | da.core.map_blocks(lambda a, b: a + 2 * b, d, e, dtype=d.dtype), x + 2 * y |
| 3227 | ) |
| 3228 | |
| 3229 | z = np.arange(100).reshape((10, 10)) |
| 3230 | f = da.from_array(z, chunks=5) |
| 3231 | |
| 3232 | func = lambda a, b: a + 2 * b |
| 3233 | res = da.core.map_blocks(func, d, f, dtype=d.dtype) |
| 3234 | assert_eq(res, x + 2 * z) |
| 3235 | assert same_keys(da.core.map_blocks(func, d, f, dtype=d.dtype), res) |
| 3236 | |
| 3237 | assert_eq(da.map_blocks(func, f, d, dtype=d.dtype), z + 2 * x) |
| 3238 | |
| 3239 | |
| 3240 | def test_from_array_with_missing_chunks(): |
nothing calls this directly
no test coverage detected