Skip to content

Commit

Permalink
Revert allowing linear interp with dayofyear, change test to use nearest
Browse files Browse the repository at this point in the history
  • Loading branch information
saschahofmann committed Jan 28, 2025
1 parent 2aadc73 commit d501a98
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions src/xclim/sdba/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}."
Expand Down
2 changes: 1 addition & 1 deletion tests/test_sdba/test_adjustment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d501a98

Please sign in to comment.