MCPcopy
hub / github.com/dask/dask / test_memmap

Function test_memmap

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

Source from the content-addressed store, hash-verified

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…