Skip to content

Commit

Permalink
fix selection for corr calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
pat-schmitt committed May 10, 2023
1 parent 354d10a commit ccf7d69
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions oggm/tests/test_prepro.py
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,7 @@ def test_mb_calibration_from_scalar_mb(self):
# Check that results are all the same
np.testing.assert_allclose(ref_mb, mbdf['melt_mb'].mean())
# Yeah, it correlates but also not too crazy
np.testing.assert_allclose(1, mbdf.corr()['ref_mb']['melt_mb'],
np.testing.assert_allclose(1, mbdf[['ref_mb', 'melt_mb']].corr(),
atol=0.35)

pdf = gdir.read_json('mb_calib')
Expand All @@ -1411,7 +1411,7 @@ def test_mb_calibration_from_scalar_mb(self):
# Check that results are all the same
np.testing.assert_allclose(ref_mb, mbdf['temp_mb'].mean())
# Yeah, it correlates but also not too crazy
np.testing.assert_allclose(1, mbdf.corr()['ref_mb']['temp_mb'],
np.testing.assert_allclose(1, mbdf[['ref_mb', 'temp_mb']].corr(),
atol=0.35)

pdf = gdir.read_json('mb_calib')
Expand All @@ -1431,7 +1431,7 @@ def test_mb_calibration_from_scalar_mb(self):
# Check that results are all the same
np.testing.assert_allclose(ref_mb, mbdf['prcp_mb'].mean())
# Yeah, it correlates but also not too crazy
np.testing.assert_allclose(1, mbdf.corr()['ref_mb']['prcp_mb'],
np.testing.assert_allclose(1, mbdf[['ref_mb', 'prcp_mb']].corr(),
atol=0.35)

pdf = gdir.read_json('mb_calib')
Expand Down Expand Up @@ -1460,7 +1460,7 @@ def test_mb_calibration_from_scalar_mb(self):
# Check that results are all the same
np.testing.assert_allclose(ref_mb, mbdf['melt_mb2'].mean())
# It should correlate even less
np.testing.assert_allclose(1, mbdf.corr()['ref_mb']['melt_mb2'],
np.testing.assert_allclose(1, mbdf[['ref_mb', 'melt_mb2']].corr(),
atol=0.55)

pdf = gdir.read_json('mb_calib')
Expand All @@ -1486,7 +1486,7 @@ def test_mb_calibration_from_scalar_mb(self):
# Check that results are all the same
np.testing.assert_allclose(ref_mb, mbdf['melt_mb2'].mean())
# It should correlate even less (maybe not)
np.testing.assert_allclose(1, mbdf.corr()['ref_mb']['melt_mb2'],
np.testing.assert_allclose(1, mbdf[['ref_mb', 'melt_mb2']].corr(),
atol=0.5)

pdf = gdir.read_json('mb_calib')
Expand Down Expand Up @@ -1515,7 +1515,7 @@ def test_mb_calibration_from_scalar_mb(self):
# Check that results are all the same
np.testing.assert_allclose(ref_mb, mbdf['melt_mb2'].mean())
# It should correlate even less (maybe not)
np.testing.assert_allclose(1, mbdf.corr()['ref_mb']['melt_mb2'],
np.testing.assert_allclose(1, mbdf[['ref_mb', 'melt_mb2']].corr(),
atol=0.45)

pdf = gdir.read_json('mb_calib')
Expand All @@ -1542,7 +1542,7 @@ def test_mb_calibration_from_scalar_mb(self):
# Check that results are all the same
np.testing.assert_allclose(ref_mb, mbdf['melt_mb2'].mean())
# It should correlate even less (maybe not)
np.testing.assert_allclose(1, mbdf.corr()['ref_mb']['melt_mb2'],
np.testing.assert_allclose(1, mbdf[['ref_mb', 'melt_mb2']].corr(),
atol=0.5)

pdf = gdir.read_json('mb_calib')
Expand Down Expand Up @@ -1578,7 +1578,7 @@ def test_mb_calibration_from_scalar_mb(self):
# Check that results are all the same
np.testing.assert_allclose(ref_mb, mbdf['melt_mb3'].mean())
# It should correlate even less (maybe not)
np.testing.assert_allclose(1, mbdf.corr()['ref_mb']['melt_mb3'],
np.testing.assert_allclose(1, mbdf[['ref_mb', 'melt_mb3']].corr(),
atol=0.5)

pdf = gdir.read_json('mb_calib')
Expand Down Expand Up @@ -1628,7 +1628,7 @@ def test_mb_calibration_from_scalar_mb(self):
# Check that results are all the same
np.testing.assert_allclose(ref_mb, mbdf['melt_mb3'].mean())
# It should correlate even less (maybe not)
np.testing.assert_allclose(1, mbdf.corr()['ref_mb']['melt_mb3'],
np.testing.assert_allclose(1, mbdf[['ref_mb', 'melt_mb3']].corr(),
atol=0.5)

pdf = gdir.read_json('mb_calib')
Expand Down

0 comments on commit ccf7d69

Please sign in to comment.