Skip to content

Commit

Permalink
add test for different training times
Browse files Browse the repository at this point in the history
  • Loading branch information
coxipi committed Dec 9, 2024
1 parent 880f98c commit fa9f2a9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_sdba/test_adjustment.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,19 @@ def test_add_dims(self, use_dask, open_dataset):
scen2 = EQM2.adjust(sim).load()
assert scen2.sel(location=["Kugluktuk", "Vancouver"]).isnull().all()

def test_different_times_training(self, series, random):
n = 10
u = random.random(n)
ref = series(u, "tas", start="2000-01-01")
u2 = random.random(n)
hist = series(u2, "tas", start="2000-01-01")
hist_fut = series(u2, "tas", start="2001-01-01")
ds = EmpiricalQuantileMapping.train(ref, hist).ds
EmpiricalQuantileMapping._allow_diff_training_times = True
ds_fut = EmpiricalQuantileMapping.train(ref, hist_fut).ds
EmpiricalQuantileMapping._allow_diff_training_times = False
assert (ds.af == ds_fut.af).all()


@pytest.mark.slow
class TestMBCn:
Expand Down

0 comments on commit fa9f2a9

Please sign in to comment.