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

Function test_memmap

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

Source from the content-addressed store, hash-verified

3538
3539
3540def test_memmap():
3541 with tmpfile("npy") as fn_1:
3542 with tmpfile("npy") as fn_2:
3543 try:
3544 x = da.arange(100, chunks=15)
3545 target = np.memmap(fn_1, shape=x.shape, mode="w+", dtype=x.dtype)
3546
3547 x.store(target)
3548
3549 assert_eq(target, x, check_type=False)
3550
3551 np.save(fn_2, target)
3552
3553 assert_eq(np.load(fn_2, mmap_mode="r"), x, check_type=False)
3554 finally:
3555 target._mmap.close()
3556
3557
3558def 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