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:3558–3569  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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