()
| 3538 | |
| 3539 | |
| 3540 | def 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 | |
| 3558 | def test_to_npy_stack(): |