Skip to content

Commit

Permalink
better test for TUW-GEO#220
Browse files Browse the repository at this point in the history
  • Loading branch information
s-scherrer committed Apr 23, 2021
1 parent 95eb54d commit 023bed8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/test_validation_framework/test_metric_calculators.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ def testdata_random():
"reference": ref,
"col1": x1,
"col2": x2,
"col3": x3,
"zcol3": x3,
},
index=dr
)
Expand All @@ -656,7 +656,7 @@ def testdata_random():
"lon": 1,
"lat": 1,
},
(("col3_name", "col3"), ("reference_name", "reference")):
(("reference_name", "reference"), ("zcol3_name", "zcol3")):
{
"n_obs": n - 2,
"gpi": 1,
Expand Down Expand Up @@ -765,13 +765,17 @@ def test_PairwiseIntercomparisonMetrics(testdata_generator):
for m in pw_metrics:
othername = key[0][0]
refname = key[1][0]
if othername == "reference_name":
# sorting might be different, see GH #220
othername = key[1][0]
refname = key[0][0]
old_m_key = f"{m}_between_{refname}_and_{othername}"
if m == "BIAS":
# PairwiseIntercomparisonMetrics has the result as (other,
# ref), and therefore "bias between other and ref", compared to
# "bias between ref and bias" in IntercomparisonMetrics
# this is related to issue #220
assert_equal(-res[m], res_old[old_m_key])
assert_equal(np.abs(res[m]), np.abs(res_old[old_m_key]))
elif m == "urmsd":
# the old implementation differs from the new implementation
pass
Expand Down

0 comments on commit 023bed8

Please sign in to comment.