From b26542efea1a26b9b1e88e7afabd05942b811ba2 Mon Sep 17 00:00:00 2001 From: Pascal Bourgault Date: Thu, 17 Oct 2024 14:17:52 -0400 Subject: [PATCH] Update stats.py to avoid FutureWarning --- xclim/indices/stats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xclim/indices/stats.py b/xclim/indices/stats.py index f6becdc63..474973c5f 100644 --- a/xclim/indices/stats.py +++ b/xclim/indices/stats.py @@ -933,7 +933,7 @@ def reindex_time(da, da_ref, group): da = da.rename(month="time").reindex(time=da_ref.time.dt.month) da["time"] = da_ref.time elif group == "time.week": - da = da.rename(week="time").reindex(time=da_ref.time.dt.week) + da = da.rename(week="time").reindex(time=da_ref.time.dt.isocalendar().week) da["time"] = da_ref.time # I don't think rechunking is necessary here, need to check return da if not uses_dask(da) else da.chunk({"time": -1})