diff --git a/CHANGELOG.rst b/CHANGELOG.rst index abfc83ece..b0d5df57b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -23,6 +23,10 @@ Internal changes * Adjusted the ``TestOfficialYaml`` test to use a dynamic method for finding the installed location of `xclim`. (:pull:`2028`). * Adjusted two tests for better handling when running in Windows environments. (:pull:`2057`). +Bug fixes +^^^^^^^^^ +* Fixed an issue in ``xclim.core.units.to_agg_units`` that broke the resampling when computing on unitless data (:pull:`2060`). + v0.54.0 (2024-12-16) -------------------- Contributors to this version: Trevor James Smith (:user:`Zeitsperre`), Pascal Bourgault (:user:`aulemahal`), Éric Dupuis (:user:`coxipi`), Sascha Hofmann (:user:`saschahofmann`). diff --git a/src/xclim/core/units.py b/src/xclim/core/units.py index 036835d3e..c4613cca9 100644 --- a/src/xclim/core/units.py +++ b/src/xclim/core/units.py @@ -666,6 +666,9 @@ def to_agg_units( >>> degdays.units 'd K' """ + if "units" not in orig.attrs: + return out + is_difference = True if op in ["std", "var"] else None if op in ["amin", "min", "amax", "max", "mean", "sum", "std"]: