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

Function test_nearest

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

Source from the content-addressed store, hash-verified

174
175
176def 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
189def test_constant():

Callers

nothing calls this directly

Calls 3

nearestFunction · 0.90
assert_eqFunction · 0.90
arangeMethod · 0.45

Tested by

no test coverage detected