Skip to content
forked from pydata/xarray

Commit

Permalink
fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Mar 8, 2021
1 parent 5555218 commit 90ddc0b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion xarray/core/dataarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -3714,7 +3714,7 @@ def map_blocks(
... calculate_anomaly, kwargs={"groupby_type": "time.year"}, template=array
... ) # doctest: +ELLIPSIS
<xarray.DataArray (time: 24)>
dask.array<calculate_anomaly-...-<this, shape=(24,), dtype=float64, chunksize=(24,), chunktype=numpy.ndarray>
dask.array<<this-array>-calculate_anomaly, shape=(24,), dtype=float64, chunksize=(24,), chunktype=numpy.ndarray>
Coordinates:
* time (time) object 1990-01-31 00:00:00 ... 1991-12-31 00:00:00
month (time) int64 dask.array<chunksize=(24,), meta=np.ndarray>
Expand Down
12 changes: 6 additions & 6 deletions xarray/core/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def make_meta(obj):
"""
if isinstance(obj, DataArray):
obj_array = obj
obj = obj._to_temp_dataset()
obj = dataarray_to_dataset(obj)
elif isinstance(obj, Dataset):
obj_array = None
else:
Expand All @@ -116,7 +116,7 @@ def make_meta(obj):
meta = meta.set_coords(obj.coords)

if obj_array is not None:
return obj_array._from_temp_dataset(meta)
return dataset_to_dataarray(meta)
return meta


Expand Down Expand Up @@ -258,7 +258,7 @@ def map_blocks(
... template=array,
... ) # doctest: +ELLIPSIS
<xarray.DataArray (time: 24)>
dask.array<calculate_anomaly-...-<this, shape=(24,), dtype=float64, chunksize=(24,), chunktype=numpy.ndarray>
dask.array<<this-array>-calculate_anomaly, shape=(24,), dtype=float64, chunksize=(24,), chunktype=numpy.ndarray>
Coordinates:
* time (time) object 1990-01-31 00:00:00 ... 1991-12-31 00:00:00
month (time) int64 dask.array<chunksize=(24,), meta=np.ndarray>
Expand Down Expand Up @@ -448,7 +448,7 @@ def subset_dataset_to_block(
for dim in variable.dims:
chunk = chunk[chunk_index[dim]]

chunk_variable_task = (f"{name}_{gname}-{chunk[0]}",) + chunk_tuple
chunk_variable_task = (f"{name}-{gname}-{chunk[0]}",) + chunk_tuple
graph[chunk_variable_task] = (
tuple,
[variable.dims, chunk, variable.attrs],
Expand All @@ -462,7 +462,7 @@ def subset_dataset_to_block(
}
subset = variable.isel(subsetter)
chunk_variable_task = (
f"{name}_{gname}-{dask.base.tokenize(subset)}",
f"{name}-{gname}-{dask.base.tokenize(subset)}",
) + chunk_tuple
graph[chunk_variable_task] = (
tuple,
Expand Down Expand Up @@ -512,7 +512,7 @@ def subset_dataset_to_block(
for name, variable in template.variables.items():
if name in indexes:
continue
gname_l = f"{name}_after_{gname}"
gname_l = f"{name}-{gname}"
var_key_map[name] = gname_l

key: Tuple[Any, ...] = (gname_l,)
Expand Down

0 comments on commit 90ddc0b

Please sign in to comment.