()
| 3535 | |
| 3536 | |
| 3537 | def 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 | |
| 3555 | def test_to_npy_stack(): |