Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No interpolation on dayofyear #2068

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ v0.55.0 (2025-02-17)
--------------------
Contributors to this version: Juliette Lavoie (:user:`juliettelavoie`), Trevor James Smith (:user:`Zeitsperre`), Sascha Hofmann (:user:`saschahofmann`), Pascal Bourgault (:user:`aulemahal`), Éric Dupuis (:user:`coxipi`), Baptiste Hamon (:user:`baptistehamon`), Sarah Gammon (:user:`SarahG-579462`).

Breaking changes
^^^^^^^^^^^^^^^^
* Missing value method "WMO" was modified to remove the criterion that the timeseries needs to be continuous (without holes). (:pull:`2058`).

Announcements
^^^^^^^^^^^^^
* `xclim` now officially supports Python 3.13 (using `numba` v0.61.0). (:issue:`2022`, :pull:`2054`).
* `xclim` version 0.55.0 will be the last version to support Python 3.10. The next version will require Python 3.11 or higher. (:pull:`2054`).
* `xclim.sdba` is in the process of being split into a separate package (`xsdba <https://github.com/Ouranosinc/xsdba>`_) to help with the maintenance of the codebase as well as better support new SDBA functionality. Feature additions to the `xclim.sdba` module will no longer be accepted and should be made instead to `xsdba`. The developers aim to ensure a high level of interoperability between `xclim` and `xsdba` so that users are minimally impacted; A migration guide will be made available in a future release. (:issue:`1948`, :issue:`2074`, :pull:`2073`).

Breaking changes
^^^^^^^^^^^^^^^^
* Missing value method "WMO" was modified to remove the criterion that the timeseries needs to be continuous (without holes). (:pull:`2058`).

New indicators
^^^^^^^^^^^^^^
* Added ``xclim.land.holiday_snow_days`` to compute the number of days with snow on the ground during holidays ("Christmas Days"). (:issue:`2029`, :pull:`2030`).
Expand All @@ -54,6 +54,7 @@ New features and enhancements
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. (:pull:`2068`).
* Fixed a bug where ``xclim.indicators.atmos.potential_evapotranspiration`` would return wrong results when `hurs` was provided in `%` (:pull:`2067`).
* Fixed the default "op" argument of ``xclim.atmos.growing_season_end`` (:issue:`2056`, :pull:`2080`).
* Removed the useless "thresh" argument from ``xclim.atmos.precip_accumulation`` (:issue:`1763`, :pull:`2080`).
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
Loading