From 8b87c2b399408f6b32ab6938566bd44707e0e648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Dupuis?= Date: Sun, 10 Sep 2023 21:51:31 -0400 Subject: [PATCH 1/3] degK to K --- CHANGES.rst | 9 +++++++++ xclim/indices/_conversion.py | 14 +++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index c059d400c..11f7915f6 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -2,6 +2,15 @@ Changelog ========= +v0.46.0 +-------------------- +Contributors to this version: Éric Dupuis (:user:`coxipi`). + +Internal changes +^^^^^^^^^^^^^^^^ +* Change "degK" to "K" used to design Kelvin units. + + v0.45.0 (2023-09-05) -------------------- Contributors to this version: David Huard (:user:`huard`), Trevor James Smith (:user:`Zeitsperre`), Pascal Bourgault (:user:`aulemahal`), Juliette Lavoie (:user:`juliettelavoie`), Gabriel Rondeau-Genesse (:user:`RondeauG`), Marco Braun (:user:`vindelico`), Éric Dupuis (:user:`coxipi`). diff --git a/xclim/indices/_conversion.py b/xclim/indices/_conversion.py index 2ae948ffe..5183c6531 100644 --- a/xclim/indices/_conversion.py +++ b/xclim/indices/_conversion.py @@ -395,9 +395,9 @@ def saturation_vapor_pressure( :cite:cts:`goff_low-pressure_1946,hardy_its-90_1998,sonntag_important_1990,tetens_uber_1930,vomel_saturation_2016,world_meteorological_organization_guide_2008` """ if ice_thresh is not None: - thresh = convert_units_to(ice_thresh, "degK") + thresh = convert_units_to(ice_thresh, "K") else: - thresh = convert_units_to("0 K", "degK") + thresh = convert_units_to("0 K", "K") tas = convert_units_to(tas, "K") ref_is_water = tas > thresh if method in ["sonntag90", "SO90"]: @@ -585,8 +585,8 @@ def relative_humidity( if method in ("bohren98", "BA90"): if tdps is None: raise ValueError("To use method 'bohren98' (BA98), dewpoint must be given.") - tdps = convert_units_to(tdps, "degK") - tas = convert_units_to(tas, "degK") + tdps = convert_units_to(tdps, "K") + tas = convert_units_to(tas, "K") L = 2.501e6 Rw = (461.5,) hurs = 100 * np.exp(-L * (tas - tdps) / (Rw * tas * tdps)) # type: ignore @@ -601,7 +601,7 @@ def relative_humidity( else: ps = convert_units_to(ps, "Pa") huss = convert_units_to(huss, "") - tas = convert_units_to(tas, "degK") + tas = convert_units_to(tas, "K") e_sat = saturation_vapor_pressure(tas=tas, ice_thresh=ice_thresh, method=method) @@ -698,7 +698,7 @@ def specific_humidity( """ ps = convert_units_to(ps, "Pa") hurs = convert_units_to(hurs, "") - tas = convert_units_to(tas, "degK") + tas = convert_units_to(tas, "K") e_sat = saturation_vapor_pressure(tas=tas, ice_thresh=ice_thresh, method=method) @@ -844,7 +844,7 @@ def snowfall_approximation( prsn = pr * fraction.interp(tas=tas, method="linear") elif method == "auer": - dtas = convert_units_to(tas, "degK") - convert_units_to(thresh, "degK") + dtas = convert_units_to(tas, "K") - convert_units_to(thresh, "K") # Create nodes for the snowfall fraction: -inf, thresh, ..., thresh+6, inf [degC] t = np.concatenate( From ecd74daf3e16885907cfd9ea8276b9e91dc7bf6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Dupuis?= Date: Mon, 11 Sep 2023 09:41:40 -0400 Subject: [PATCH 2/3] add pull number --- CHANGES.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 11f7915f6..d46479335 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,7 +8,7 @@ Contributors to this version: Éric Dupuis (:user:`coxipi`). Internal changes ^^^^^^^^^^^^^^^^ -* Change "degK" to "K" used to design Kelvin units. +* Change "degK" to "K" used to design Kelvin units. (:pull:`1475`). v0.45.0 (2023-09-05) From 0a2da798aeb8602b9483060806c08eaeba7b7862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Dupuis?= Date: Mon, 11 Sep 2023 09:42:40 -0400 Subject: [PATCH 3/3] remove one whitespace in CHANGES --- CHANGES.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index d46479335..c6d99980d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -10,7 +10,6 @@ Internal changes ^^^^^^^^^^^^^^^^ * Change "degK" to "K" used to design Kelvin units. (:pull:`1475`). - v0.45.0 (2023-09-05) -------------------- Contributors to this version: David Huard (:user:`huard`), Trevor James Smith (:user:`Zeitsperre`), Pascal Bourgault (:user:`aulemahal`), Juliette Lavoie (:user:`juliettelavoie`), Gabriel Rondeau-Genesse (:user:`RondeauG`), Marco Braun (:user:`vindelico`), Éric Dupuis (:user:`coxipi`).