Skip to content

Commit

Permalink
only chunk if necessary, check if dask used (review)
Browse files Browse the repository at this point in the history
Co-authored-by: Pascal Bourgault <[email protected]>
  • Loading branch information
coxipi and aulemahal authored Oct 23, 2023
1 parent 7f46856 commit 59e7df6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xclim/indices/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ def reindex_time(da, da_ref):
elif group == "time.month":
da = da.rename(month="time").reindex(time=da_ref.time.dt.month)
da["time"] = da_ref.time
return da.chunk({"time": -1})
return da if not uses_dask(da) else da.chunk({"time": -1})

probs_of_zero = da.groupby(group).map(
lambda x: (x == 0).sum("time") / x.notnull().sum("time")
Expand Down

0 comments on commit 59e7df6

Please sign in to comment.