From a17d3d9def9f5cd1a09862fdc767573d0c2bb7a3 Mon Sep 17 00:00:00 2001 From: juliettelavoie Date: Mon, 20 Feb 2023 11:44:44 -0500 Subject: [PATCH 1/3] add context='infer' --- xclim/sdba/adjustment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xclim/sdba/adjustment.py b/xclim/sdba/adjustment.py index d26012e2c..f37c3474d 100644 --- a/xclim/sdba/adjustment.py +++ b/xclim/sdba/adjustment.py @@ -647,7 +647,7 @@ def _train( ref_params: xr.Dataset = None, q_thresh: float = 0.95, ): - cluster_thresh = convert_units_to(cluster_thresh, ref) + cluster_thresh = convert_units_to(cluster_thresh, ref, context='infer') # Approximation of how many "quantiles" values we will get: N = (1 - q_thresh) * ref.time.size From b2399d24490307a95907d5c9375971c450cfabbb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 20 Feb 2023 16:59:27 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- xclim/sdba/adjustment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xclim/sdba/adjustment.py b/xclim/sdba/adjustment.py index f37c3474d..47b524453 100644 --- a/xclim/sdba/adjustment.py +++ b/xclim/sdba/adjustment.py @@ -647,7 +647,7 @@ def _train( ref_params: xr.Dataset = None, q_thresh: float = 0.95, ): - cluster_thresh = convert_units_to(cluster_thresh, ref, context='infer') + cluster_thresh = convert_units_to(cluster_thresh, ref, context="infer") # Approximation of how many "quantiles" values we will get: N = (1 - q_thresh) * ref.time.size From 62abd3903fda7f2661b43d316952b4bc76910295 Mon Sep 17 00:00:00 2001 From: juliettelavoie Date: Mon, 20 Feb 2023 11:59:48 -0500 Subject: [PATCH 3/3] add history --- HISTORY.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/HISTORY.rst b/HISTORY.rst index 1b19b5b84..ec321fff2 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -35,6 +35,7 @@ Internal changes * Added `[radiation]` (`[power] / [area]`) to list of defined acceptable units. (:pull:`1271`). * Updated testing data used to generate the `atmosds` dataset to use more reproducibly-converted ERA5 data, generated with the `miranda` Python package. (:pull:`1269`). * Updated testing dependencies to use `pytest-xdist>=3.2`, allowing for the new `--dist=worksteal` scheduler for distributing the pool of remaining tests across workers after individual workers have exhausted their own queues. (:pull:`1235`). +* Adding infer context to the unit conversion in of the training of ExtremeValues. (:pull:`1299`). 0.40.0 (2023-01-13) -------------------