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

Function test_boundaries

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

Source from the content-addressed store, hash-verified

199
200
201def test_boundaries():
202 x = np.arange(64).reshape((8, 8))
203 d = da.from_array(x, chunks=(4, 4))
204
205 e = boundaries(d, {0: 2, 1: 1}, {0: 0, 1: "periodic"})
206
207 expected = np.array(
208 [
209 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
210 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
211 [7, 0, 1, 2, 3, 4, 5, 6, 7, 0],
212 [15, 8, 9, 10, 11, 12, 13, 14, 15, 8],
213 [23, 16, 17, 18, 19, 20, 21, 22, 23, 16],
214 [31, 24, 25, 26, 27, 28, 29, 30, 31, 24],
215 [39, 32, 33, 34, 35, 36, 37, 38, 39, 32],
216 [47, 40, 41, 42, 43, 44, 45, 46, 47, 40],
217 [55, 48, 49, 50, 51, 52, 53, 54, 55, 48],
218 [63, 56, 57, 58, 59, 60, 61, 62, 63, 56],
219 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
220 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
221 ]
222 )
223 assert_eq(e, expected)
224
225
226def test_overlap():

Callers

nothing calls this directly

Calls 4

boundariesFunction · 0.90
assert_eqFunction · 0.90
reshapeMethod · 0.80
arangeMethod · 0.45

Tested by

no test coverage detected