sid.testing_allocation

Module Contents

Functions

allocate_tests(states: pandas.DataFrame, testing_allocation_models: Dict[str, Dict[str, Any]], demands_test: pandas.Series, params: pandas.DataFrame, date: pandas.Timestamp, seed: itertools.count) → pandas.Series

Allocate tests to people who demand one.

update_pending_tests(states: pandas.DataFrame, allocated_tests: pandas.Series) → pandas.DataFrame

Update information regarding pending tests.

allocate_tests(states: pandas.DataFrame, testing_allocation_models: Dict[str, Dict[str, Any]], demands_test: pandas.Series, params: pandas.DataFrame, date: pandas.Timestamp, seed: itertools.count) pandas.Series[source]

Allocate tests to people who demand one.

The function iterates over all test allocation models and each model is able to see how many tests have already been allotted by the previous models.

Parameters
  • states (pandas.DataFrame) – The states of all individuals.

  • testing_demand_models (Dict[str, Dict[str, Any]]) – A dictionary containing the demand models for testing.

  • demands_test (pandas.Series) – A boolean series indicating which person demands a test.

  • params (pandas.DataFrame) – The parameter DataFrame.

  • date (pandas.Timestamp) – Current date.

  • seed (itertools.count) – The seed counter.

Returns

A boolean series indicating which

individuals received a test.

Return type

all_allocated_tests (pandas.Series)

update_pending_tests(states: pandas.DataFrame, allocated_tests: pandas.Series) pandas.DataFrame[source]

Update information regarding pending tests.