Skip to content

Commit

Permalink
test, fix: Fixed test_presrat_transform_nochanges()
Browse files Browse the repository at this point in the history
It was missing to force K=1, otherwise any difference in the means would
result in a K that would change the unbiased.
  • Loading branch information
castelao committed Jul 22, 2024
1 parent 0aaf49b commit 9b391f5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/bias/test_presrat_bias_correction.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,11 @@ def presrat_identity_params(tmpdir_factory, presrat_params):

@pytest.fixture(scope='module')
def presrat_nochanges_params(tmpdir_factory, presrat_params):
"""Identical distribution and no zero rate
"""Identical distribution, no zero rate, and K=1
All distributions are identical and zero rate changes are all zero,
therefore, the PresRat correction should not change anything.
All distributions are identical, zero rate changes are all zero, and the
K factor is equal to 1, therefore, the PresRat correction should not change
anything.
Note that distributions are based on bias_fut, so it is assumed that the
test cases will be datasets coherent with that bias_fut distribution,
Expand All @@ -404,6 +405,7 @@ def presrat_nochanges_params(tmpdir_factory, presrat_params):
f['bias_fut_rsds_params'][:] = f['bias_rsds_params'][:]
f['base_ghi_params'][:] = f['bias_rsds_params'][:]
f['ghi_zero_rate'][:] *= 0
f['rsds_k_factor'][:] = 1
f.flush()

return str(fn)
Expand Down Expand Up @@ -669,7 +671,6 @@ def test_presrat_transform(presrat_params, precip_fut):
assert n_zero <= unbiased_n_zero


@pytest.mark.skip()
def test_presrat_transform_nochanges(presrat_nochanges_params, fut_cc_notrend):
"""The correction should result in no changes at all
Expand Down

0 comments on commit 9b391f5

Please sign in to comment.