Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zero tests recorded if hospitalisation fraction set to zero #176

Open
p-robot opened this issue Sep 22, 2020 · 0 comments
Open

Zero tests recorded if hospitalisation fraction set to zero #176

p-robot opened this issue Sep 22, 2020 · 0 comments

Comments

@p-robot
Copy link
Contributor

p-robot commented Sep 22, 2020

The n_tests column of the time series records zero tests if hospitalisation fraction is zero in all age groups (total infected added as a superfluous variable in case --showlocals is flagged in pytest to highlight that infection is occurring). This test fails (if put in test_interventions.py, for instance), whereas I would have expected it to have passed.

    def test_testing_outside_hospitalisation( self ):
        """
        Check there can be testing outside of hospitalisation
        """

        params = utils.get_params_swig()
        params.set_param("n_total", 50000)
        params.set_param( "infectious_rate", 7.25 )

         # Set hospitalisation fraction to zero in all age groups
        utils.set_hospitalisation_fraction_all(params, 0)

        # Give everyone the app and all interactions are traceable
        params.set_param("traceable_interaction_fraction", 1)
        utils.set_app_users_fraction_all(params, 1)
        params.set_param( "test_on_symptoms", 1 )
        
        model  = utils.get_model_swig( params )
        
        model.one_time_step()
        model.update_running_params("app_turned_on", 1 )
        model.update_running_params("trace_on_symptoms", 1)
        model.update_running_params("trace_on_positive", 1)
        model.update_running_params("test_on_traced", 1)
        
        n_tests = []; total_infected = []
        for time in range( 60 ):
            model.one_time_step()
            n_tests.append(model.one_time_step_results()["n_tests"])
            total_infected.append(model.one_time_step_results()["total_infected"])
        
        total_tests = np.sum(n_tests)
        final_infected = total_infected[-1]
        np.testing.assert_equal( total_tests > 0, True )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant