File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -353,6 +353,8 @@ def _wrapper(
353
353
dataarray_to_dataset (arg ) if isinstance (arg , DataArray ) else arg
354
354
for arg in aligned
355
355
)
356
+ # rechunk any numpy variables appropriately
357
+ xarray_objs = tuple (arg .chunk (arg .chunksizes ) for arg in xarray_objs )
356
358
357
359
merged_coordinates = merge ([arg .coords for arg in aligned ]).coords
358
360
@@ -480,6 +482,8 @@ def subset_dataset_to_block(
480
482
[variable .dims , chunk , variable .attrs ],
481
483
)
482
484
else :
485
+ assert name in dataset .dims or variable .ndim == 0
486
+
483
487
# non-dask array possibly with dimensions chunked on other variables
484
488
# index into variable appropriately
485
489
subsetter = {
@@ -498,7 +502,7 @@ def subset_dataset_to_block(
498
502
chunk_variable_task = (
499
503
f"{ name } -{ gname } -{ dask .base .tokenize (subsetter )} " ,
500
504
) + this_var_chunk_tuple
501
- if chunk_variable_task not in graph :
505
+ if variable . ndim == 0 or chunk_variable_task not in graph :
502
506
subset = variable .isel (subsetter )
503
507
graph [chunk_variable_task ] = (
504
508
tuple ,
You can’t perform that action at this time.
0 commit comments