Skip to content

Commit

Permalink
doy grouping: no doy interp
Browse files Browse the repository at this point in the history
  • Loading branch information
coxipi committed Feb 7, 2025
1 parent 6db481a commit 15849b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Changelog

v0.55.0 (unreleased)
--------------------
Contributors to this version: Juliette Lavoie (:user:`juliettelavoie`), Trevor James Smith (:user:`Zeitsperre`), Sascha Hofmann (:user:`saschahofmann`).
Contributors to this version: Juliette Lavoie (:user:`juliettelavoie`), Trevor James Smith (:user:`Zeitsperre`), Sascha Hofmann (:user:`saschahofmann`), Éric Dupuis (:user:`coxipi`).

Announcements
^^^^^^^^^^^^^
Expand Down Expand Up @@ -33,6 +33,7 @@ Internal changes
Bug fixes
^^^^^^^^^
* Fixed a bug in ``xclim.sdba.Grouper.get_index`` that didn't correctly interpolate seasonal values (:issue:`2014`, :pull:`2019`).
* When using a dayofyear grouping, `sdba.utils.interp_on_quantiles` will not interpolate on the dayofyear dimension.
* Fixed a bug where ``xclim.indicators.atmos.potential_evapotranspiration`` would return wrong results when `hurs` was provided in `%` (:pull:`2067`).

v0.54.0 (2024-12-16)
Expand Down
13 changes: 8 additions & 5 deletions src/xclim/sdba/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,11 +464,14 @@ def interp_on_quantiles(
dim = group.dim
prop = group.prop

if prop == "group":
if "group" in xq.dims:
xq = xq.squeeze("group", drop=True)
if "group" in yq.dims:
yq = yq.squeeze("group", drop=True)
# dayofyear case does not require interpolation
# on the dayofyear dimension
if prop in ["group", "dayofyear"]:
if prop == "group":
if "group" in xq.dims:
xq = xq.squeeze("group", drop=True)
if "group" in yq.dims:
yq = yq.squeeze("group", drop=True)

out = xr.apply_ufunc(
_interp_on_quantiles_1D,
Expand Down

0 comments on commit 15849b3

Please sign in to comment.