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

Function test_memmap

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

Source from the content-addressed store, hash-verified

3535
3536
3537def test_memmap():
3538 with tmpfile("npy") as fn_1:
3539 with tmpfile("npy") as fn_2:
3540 try:
3541 x = da.arange(100, chunks=15)
3542 target = np.memmap(fn_1, shape=x.shape, mode="w+", dtype=x.dtype)
3543
3544 x.store(target)
3545
3546 assert_eq(target, x, check_type=False)
3547
3548 np.save(fn_2, target)
3549
3550 assert_eq(np.load(fn_2, mmap_mode="r"), x, check_type=False)
3551 finally:
3552 target._mmap.close()
3553
3554
3555def test_to_npy_stack():

Callers

nothing calls this directly

Calls 6

tmpfileFunction · 0.90
assert_eqFunction · 0.90
storeMethod · 0.80
loadMethod · 0.80
closeMethod · 0.80
arangeMethod · 0.45

Tested by

no test coverage detected