From 612a4c8e08102546bcbe7fd60f22a22c256f67ea Mon Sep 17 00:00:00 2001 From: Nicolas Mounet Date: Mon, 31 May 2021 16:38:00 +0200 Subject: [PATCH] New expiration test to make sure expiration rates are correct --- cara/tests/test_expiration.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cara/tests/test_expiration.py b/cara/tests/test_expiration.py index ff08798b..1a6fdbb7 100644 --- a/cara/tests/test_expiration.py +++ b/cara/tests/test_expiration.py @@ -26,3 +26,18 @@ def test_multiple(): e = models.MultipleExpiration([e1, e2], weights) mask = models.Mask.types['Type I'] npt.assert_almost_equal(e_expected.aerosols(mask), e.aerosols(mask)) + + +# expected values obtained from separate model +@pytest.mark.parametrize( + "BLO_weights, expected_aerosols", + [ + [(1.,0.,0.), 1.38924e-12], + [(1.,1.,1.), 1.07129e-10], + [(1.,5.,5.), 5.30088e-10], + ], +) +def test_expiration_aerosols(BLO_weights, expected_aerosols): + mask = models.Mask.types['No mask'] + e = models.Expiration(BLO_weights) + npt.assert_allclose(e.aerosols(mask), expected_aerosols, rtol=1e-4)