MCPcopy
hub / github.com/dask/dask / test_to_npy_stack

Function test_to_npy_stack

dask/array/tests/test_array_core.py:3565–3576  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3563
3564
3565def test_to_npy_stack():
3566 x = np.arange(5 * 10 * 10).reshape((5, 10, 10))
3567 d = da.from_array(x, chunks=(2, 4, 4))
3568
3569 with tmpdir() as dirname:
3570 stackdir = os.path.join(dirname, "test")
3571 da.to_npy_stack(stackdir, d, axis=0)
3572 assert os.path.exists(os.path.join(stackdir, "0.npy"))
3573 assert (np.load(os.path.join(stackdir, "1.npy")) == x[2:4]).all()
3574
3575 e = da.from_npy_stack(stackdir)
3576 assert_eq(d, e)
3577
3578
3579def test_view():

Callers

nothing calls this directly

Calls 7

tmpdirFunction · 0.90
assert_eqFunction · 0.90
reshapeMethod · 0.80
loadMethod · 0.80
arangeMethod · 0.45
joinMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…