()
| 174 | |
| 175 | |
| 176 | def test_nearest(): |
| 177 | x = np.arange(10) |
| 178 | d = da.from_array(x, chunks=(5, 5)) |
| 179 | |
| 180 | e = nearest(d, axis=0, depth=2) |
| 181 | expected = np.array([0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 9]) |
| 182 | assert_eq(e, expected) |
| 183 | |
| 184 | e = nearest(d, axis=0, depth=1) |
| 185 | expected = np.array([0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9]) |
| 186 | assert_eq(e, expected) |
| 187 | |
| 188 | |
| 189 | def test_constant(): |