From d501a98b1539437016931db8ff408e5bdd3a310c Mon Sep 17 00:00:00 2001 From: saschahofmann Date: Tue, 28 Jan 2025 16:28:59 +0100 Subject: [PATCH] Revert allowing linear interp with dayofyear, change test to use nearest --- src/xclim/sdba/base.py | 2 -- tests/test_sdba/test_adjustment.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/xclim/sdba/base.py b/src/xclim/sdba/base.py index 4baa9edf0..0c2d3f626 100644 --- a/src/xclim/sdba/base.py +++ b/src/xclim/sdba/base.py @@ -311,8 +311,6 @@ def get_index( # the first season is shifted by 1 month the but the middle of the season is shifted in the other direction # by half a month so -(1/12-1/24)*4 = -1/6 i = ind.dayofyear / length_year * 4 - 1 / 6 - elif self.prop == "dayofyear": - i = ind.dayofyear else: raise ValueError( f"Interpolation is not supported for {self.dim}.{self.prop}." diff --git a/tests/test_sdba/test_adjustment.py b/tests/test_sdba/test_adjustment.py index d9a348ea7..670b24cd0 100644 --- a/tests/test_sdba/test_adjustment.py +++ b/tests/test_sdba/test_adjustment.py @@ -842,7 +842,7 @@ def test_real_data(self, open_dataset): ref, hist, group=Grouper("time.dayofyear", window=31), nquantiles=quantiles ) - scen = EQM.adjust(hist, interp="linear", extrapolation="constant") + scen = EQM.adjust(hist, extrapolation="constant") EX = ExtremeValues.train(ref, hist, cluster_thresh="1 mm/day", q_thresh=0.97) new_scen = EX.adjust(scen, hist, frac=0.000000001)