src.testing.rapid_tests

Functions for rapid tests.

Module Contents

Functions

rapid_test_demand(receives_rapid_test, states, params, contacts, seed, save_path=None, randomize=False, share_refuser=None)

Assign rapid tests to group.

_calculate_educ_rapid_test_demand(states, contacts, educ_worker_multiplier, student_multiplier, frequency)

Return which individuals get a rapid test in an education setting.

_get_eligible_educ_participants(states, contacts, frequency)

_get_educ_worker_demand(eligible, states, educ_worker_multiplier)

_get_student_demand(eligible, states, student_multiplier)

_calculate_work_rapid_test_demand(states, contacts, compliance_multiplier)

_calculate_hh_member_rapid_test_demand(states, demand_share)

Calculate demand by household members of positive tested and fresh symptomatics.

_calculate_own_symptom_rapid_test_demand(states, demand_share)

Calculate the demand by symptomatic individuals who have no PCR test scheduled.

_calculate_other_meeting_rapid_test_demand(states, contacts, demand_share)

_determine_if_hh_had_event(states)

Determine who had a potential rapid test triggering event in their household.

_randomize_rapid_tests(states, target_share_to_be_tested, share_refuser, seed)

rapid_test_demand(receives_rapid_test, states, params, contacts, seed, save_path=None, randomize=False, share_refuser=None)[source]

Assign rapid tests to group.

Starting after Easter, all education workers and pupils attending school receive a test if they participate in school and haven’t received a rapid test within 4 days.

Workers also get tested and more so as time increases.

Lastly, household members of individuals with symptoms, a positive PCR test or a positive rapid test demand a rapid test with 85% probability.

If randomize is True the calculated demand is distributed randomly in the entire population (excluding a share of refusers).

_calculate_educ_rapid_test_demand(states, contacts, educ_worker_multiplier, student_multiplier, frequency)[source]

Return which individuals get a rapid test in an education setting.

Parameters
  • states (pandas.DataFrame) – states DataFrame

  • contacts (pandas.DataFrame) – DataFrame with the same index as states. columns are the contact model names. All education contact models start with educ_. All education columns are recurrent, i.e. are boolean.

  • educ_worker_multiplier (float) – share of educ workers that have not been tested long enough and have education contacts that receive and accept a test.

  • student_multiplier (float) – share of school students that have not been tested long enough and have education contacts that receive and accept a test.

  • frequency (int) – test every [frequency] days

_get_eligible_educ_participants(states, contacts, frequency)[source]
_get_educ_worker_demand(eligible, states, educ_worker_multiplier)[source]
_get_student_demand(eligible, states, student_multiplier)[source]
_calculate_work_rapid_test_demand(states, contacts, compliance_multiplier)[source]
_calculate_hh_member_rapid_test_demand(states, demand_share)[source]

Calculate demand by household members of positive tested and fresh symptomatics.

Parameters
  • states (pandas.DataFrame) – sid states DataFrame

  • demand_share (float) – share of household members that request a rapid test in response to an event in their household. Individuals with a quarantine compliance above 1 - demand_share request a rapid test.

_calculate_own_symptom_rapid_test_demand(states, demand_share)[source]

Calculate the demand by symptomatic individuals who have no PCR test scheduled.

We assume that there is no difference in the propensity to take a rapid test irrespective of whether it’s own symptoms or symptoms in a household member.

_calculate_other_meeting_rapid_test_demand(states, contacts, demand_share)[source]
_determine_if_hh_had_event(states)[source]

Determine who had a potential rapid test triggering event in their household.

Returns

Series with the same index as states.

True for individuals where a household member got symptoms yesterday, who received a positive rapid test yesterday or who have a new known case in their household.

Return type

had_event_in_hh (pandas.Series)

_randomize_rapid_tests(states, target_share_to_be_tested, share_refuser, seed)[source]