sid.rapid_tests

Module Contents

Functions

perform_rapid_tests(date: pd.Timestamp, states: pd.DataFrame, params: pd.DataFrame, rapid_test_models: Optional[Callable], contacts: pd.DataFrame, seed: itertools.count) → pd.DataFrame

Perform testing with rapid tests.

apply_reactions_to_rapid_tests(date, states, params, rapid_test_reaction_models, contacts, seed)

Apply reactions to rapid_tests.

_compute_who_receives_rapid_tests(date, states, params, rapid_test_models, contacts, seed)

Compute who receives rapid tests.

_sample_test_outcome(states, receives_rapid_test, params, seed)

Sample the outcomes of the rapid tests.

_create_sensitivity(states, sensitivity_params)

Create the sensitivity se

_update_states_with_rapid_tests_outcomes(states, receives_rapid_test, is_tested_positive)

Updates states with outcomes of rapid tests.

perform_rapid_tests(date: pd.Timestamp, states: pd.DataFrame, params: pd.DataFrame, rapid_test_models: Optional[Callable], contacts: pd.DataFrame, seed: itertools.count)pd.DataFrame[source]

Perform testing with rapid tests.

apply_reactions_to_rapid_tests(date, states, params, rapid_test_reaction_models, contacts, seed)[source]

Apply reactions to rapid_tests.

_compute_who_receives_rapid_tests(date, states, params, rapid_test_models, contacts, seed)[source]

Compute who receives rapid tests.

We loop over all rapid tests models and collect newly allocated rapid tests in receives_rapid_test. A copy of the series is passed to each rapid test model so that the user is aware of who is tested, but cannot alter the existing assignment.

_sample_test_outcome(states, receives_rapid_test, params, seed)[source]

Sample the outcomes of the rapid tests.

For those who are infectious, sensitivity gives us the probability that they are also tested positive.

For those who are not infectious, 1 - specificity gives us the probability that they are falsely tested positive.

_create_sensitivity(states, sensitivity_params)[source]

Create the sensitivity se

_update_states_with_rapid_tests_outcomes(states, receives_rapid_test, is_tested_positive)[source]

Updates states with outcomes of rapid tests.