()
| 3563 | |
| 3564 | |
| 3565 | def test_to_npy_stack(): |
| 3566 | x = np.arange(5 * 10 * 10).reshape((5, 10, 10)) |
| 3567 | d = da.from_array(x, chunks=(2, 4, 4)) |
| 3568 | |
| 3569 | with tmpdir() as dirname: |
| 3570 | stackdir = os.path.join(dirname, "test") |
| 3571 | da.to_npy_stack(stackdir, d, axis=0) |
| 3572 | assert os.path.exists(os.path.join(stackdir, "0.npy")) |
| 3573 | assert (np.load(os.path.join(stackdir, "1.npy")) == x[2:4]).all() |
| 3574 | |
| 3575 | e = da.from_npy_stack(stackdir) |
| 3576 | assert_eq(d, e) |
| 3577 | |
| 3578 | |
| 3579 | def test_view(): |