Skip to content

Commit

Permalink
hack? Needed to solve a problem that was appearing.
Browse files Browse the repository at this point in the history
  • Loading branch information
keflavich committed Jan 30, 2024
1 parent ba28206 commit e44ade4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion reproject/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ def _dask_to_numpy_memmap(dask_array, tmp_dir):
with tempfile.TemporaryDirectory() as zarr_tmp:
# First compute and store the dask array to zarr using whatever
# the default scheduler is at this point
dask_array.to_zarr(zarr_tmp)
try:
dask_array.to_zarr(zarr_tmp)
except ValueError:
dask_array.rechunk().to_zarr(zarr_tmp)

Check warning on line 44 in reproject/utils.py

View check run for this annotation

Codecov / codecov/patch

reproject/utils.py#L43-L44

Added lines #L43 - L44 were not covered by tests

# Load the array back to dask
zarr_array = da.from_zarr(zarr_tmp)
Expand Down

0 comments on commit e44ade4

Please sign in to comment.