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

Function test_to_npy_stack

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

Source from the content-addressed store, hash-verified

3553
3554
3555def test_to_npy_stack():
3556 x = np.arange(5 * 10 * 10).reshape((5, 10, 10))
3557 d = da.from_array(x, chunks=(2, 4, 4))
3558
3559 with tmpdir() as dirname:
3560 stackdir = os.path.join(dirname, "test")
3561 da.to_npy_stack(stackdir, d, axis=0)
3562 assert os.path.exists(os.path.join(stackdir, "0.npy"))
3563 assert (np.load(os.path.join(stackdir, "1.npy")) == x[2:4]).all()
3564
3565 e = da.from_npy_stack(stackdir)
3566 assert_eq(d, e)
3567
3568
3569def 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