| 5789 | |
| 5790 | |
| 5791 | def test_auto_chunks_h5py(): |
| 5792 | h5py = pytest.importorskip("h5py") |
| 5793 | |
| 5794 | with tmpfile(".hdf5") as fn: |
| 5795 | with h5py.File(fn, mode="a") as f: |
| 5796 | d = f.create_dataset( |
| 5797 | "/x", shape=(1000, 1000), chunks=(32, 64), dtype="float64" |
| 5798 | ) |
| 5799 | d[:] = 1 |
| 5800 | |
| 5801 | with h5py.File(fn, mode="a") as f: |
| 5802 | d = f["x"] |
| 5803 | with dask.config.set({"array.chunk-size": "1 MiB"}): |
| 5804 | x = da.from_array(d) |
| 5805 | assert isinstance(x._meta, np.ndarray) |
| 5806 | assert x.chunks == ((256, 256, 256, 232), (512, 488)) |
| 5807 | |
| 5808 | |
| 5809 | def test_no_warnings_from_blockwise(): |