Skip to content

Commit

Permalink
added test for delta range protection
Browse files Browse the repository at this point in the history
  • Loading branch information
grantbuster committed Nov 4, 2024
1 parent e5578db commit 2adc61d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_bc.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,11 @@ def test_difficult_qdm():
delta_denom_min=0.01)
arr_bc = qdm_rel_fut(arr[:, np.newaxis])
assert arr_bc.max() < 40 # fixed result

# test that delta_range fixes this
qdm_rel_fut = QuantileDeltaMapping(params_oh, params_mh, params_mf,
dist='empirical', relative=True,
sampling='invlog', log_base=10,
delta_range=(0.5, 1.5))
arr_bc = qdm_rel_fut(arr[:, np.newaxis])
assert arr_bc.max() < (arr.max() * 1.5) # fixed result

0 comments on commit 2adc61d

Please # to comment.