From 2c3b267af0f97f5ca516566e1c7572db2c818292 Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Tue, 5 Oct 2021 15:57:18 +0200 Subject: [PATCH] Updated probability of infection values on tests --- cara/tests/models/test_exposure_model.py | 24 +++++++++++----------- cara/tests/test_monte_carlo_full_models.py | 20 +++++++++--------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/cara/tests/models/test_exposure_model.py b/cara/tests/models/test_exposure_model.py index 0a39d90c..c65b0990 100644 --- a/cara/tests/models/test_exposure_model.py +++ b/cara/tests/models/test_exposure_model.py @@ -74,23 +74,23 @@ def known_concentrations(func): @pytest.mark.parametrize( - "population, cm, f_dep, expected_exposure, expected_probability", [ - [populations[1], known_concentrations(lambda t: 36.), 1., - np.array([432, 432]), np.array([99.6803184113, 99.5181053773])], + "population, cm, expected_exposure, expected_probability", [ + [populations[1], known_concentrations(lambda t: 36.), + np.array([432, 432]), np.array([77.2191556943, 74.6803506895])], - [populations[2], known_concentrations(lambda t: 36.), 1., - np.array([432, 432]), np.array([97.4574432074, 98.3493482895])], + [populations[2], known_concentrations(lambda t: 36.), + np.array([432, 432]), np.array([61.1470214407, 65.2366759251])], - [populations[0], known_concentrations(lambda t: np.array([36., 72.])), 1., - np.array([432, 864]), np.array([98.3493482895, 99.9727534893])], + [populations[0], known_concentrations(lambda t: np.array([36., 72.])), + np.array([432, 864]), np.array([65.2366759251, 87.9151129926])], - [populations[1], known_concentrations(lambda t: np.array([36., 72.])), 1., - np.array([432, 864]), np.array([99.6803184113, 99.9976777757])], + [populations[1], known_concentrations(lambda t: np.array([36., 72.])), + np.array([432, 864]), np.array([77.2191556943, 93.589153588])], - [populations[0], known_concentrations(lambda t: 72.), np.array([0.5, 1.]), - 864, np.array([98.3493482895, 99.9727534893])], + [populations[2], known_concentrations(lambda t: np.array([36., 72.])), + np.array([432, 864]), np.array([61.1470214407, 87.9151129926])], ]) -def test_exposure_model_ndarray(population, cm, f_dep, +def test_exposure_model_ndarray(population, cm, expected_exposure, expected_probability): model = ExposureModel(cm, population) np.testing.assert_almost_equal( diff --git a/cara/tests/test_monte_carlo_full_models.py b/cara/tests/test_monte_carlo_full_models.py index 6b32ad94..de3e6f0d 100644 --- a/cara/tests/test_monte_carlo_full_models.py +++ b/cara/tests/test_monte_carlo_full_models.py @@ -249,12 +249,12 @@ def skagit_chorale_mc(): @pytest.mark.parametrize( "mc_model, expected_pi, expected_new_cases, expected_dose, expected_ER", [ - ["shared_office_mc", 10.7, 0.32, 57.24, 654], - ["classroom_mc", 36.1, 6.85, 780.0, 28464], - ["ski_cabin_mc", 16.3, 0.49, 35.94, 7404], - ["gym_mc", 2.25, 0.63, 0.7842, 1968], - ["waiting_room_mc", 9.72, 1.36, 34.26, 3534], - ["skagit_chorale_mc",29.9, 17.9, 190.0, 141400], + ["shared_office_mc", 2.3, 0.32, 57.24, 654], + ["classroom_mc", 16.1, 6.85, 780.0, 28464], + ["ski_cabin_mc", 4.4, 0.49, 35.94, 7404], + ["gym_mc", 0.57, 0.63, 0.7842, 1968], + ["waiting_room_mc", 2.02, 1.36, 34.26, 3534], + ["skagit_chorale_mc",11.42, 17.9, 190.0, 141400], ] ) def test_report_models(mc_model, expected_pi, expected_new_cases, @@ -275,10 +275,10 @@ def test_report_models(mc_model, expected_pi, expected_new_cases, @pytest.mark.parametrize( "mask_type, month, expected_pi, expected_dose, expected_ER", [ - ["No mask", "Jul", 30.0, 405.84, 3894], - ["Type I", "Jul", 10.2, 73.38, 702], - ["FFP2", "Jul", 4.0, 73.38, 702], - ["Type I", "Feb", 4.25, 21.42, 702], + ["No mask", "Jul", 11.68, 405.84, 3894], + ["Type I", "Jul", 2.12, 73.38, 702], + ["FFP2", "Jul", 0.66, 73.38, 702], + ["Type I", "Feb", 0.73, 21.42, 702], ], ) def test_small_shared_office_Geneva(mask_type, month, expected_pi,