sid.update_states

Module Contents

Functions

update_states(states: pd.DataFrame, newly_infected_contacts: pd.Series, newly_infected_events: pd.Series, params: pd.DataFrame, virus_strains: Dict[str, Any], to_be_processed_tests: Optional[pd.Series], newly_vaccinated: pd.Series, seed: itertools.count, derived_state_variables)

Update the states with new infections and advance it by one period.

_update_countdowns(states)

Update countdowns.

_update_info_on_newly_infected(states, newly_infected_contacts, newly_infected_events, virus_strains)

Update information with newly infected individuals.

_kill_people_over_icu_limit(states, params, seed)

Kill people over the ICU limit.

_update_info_on_new_tests(states: pd.DataFrame, to_be_processed_tests: pd.Series) → pd.DataFrame

_update_info_on_new_vaccinations(states: pd.DataFrame, newly_vaccinated: pd.Series) → pd.DataFrame

Activate the counter for immunity by vaccinations.

update_derived_state_variables(states, derived_state_variables)

update_states(states: pd.DataFrame, newly_infected_contacts: pd.Series, newly_infected_events: pd.Series, params: pd.DataFrame, virus_strains: Dict[str, Any], to_be_processed_tests: Optional[pd.Series], newly_vaccinated: pd.Series, seed: itertools.count, derived_state_variables)[source]

Update the states with new infections and advance it by one period.

States are changed in place to save copying!

Parameters
  • states (pandas.DataFrame) – See The states DataFrame.

  • newly_infected_contacts (pandas.Series) – Boolean series indicating individuals infected by contacts. There can be an overlap with infections by events.

  • newly_infected_events (pandas.Series) – Boolean series indicating individuals infected by events. There can be an overlap with infections by contacts.

  • params (pandas.DataFrame) – See params.

  • virus_strains (Dict[str, Any]) – A dictionary with the keys "names" and "factors" holding the different contagiousness factors of multiple viruses.

  • to_be_processed_tests (pandas.Series) – Tests which are going to be processed.

  • newly_vaccinated (Optional[pandas.Series]) – A series which indicates newly vaccinated people.

  • seed (itertools.count) – Seed counter to control randomness.

  • derived_state_variables (Dict[str, str]) – A dictionary that maps names of state variables to pandas evaluation strings that generate derived state variables, i.e. state variables that can be calculated from the existing state variables.

Returns: states (pandas.DataFrame): Updated states with reduced countdown lengths,

newly started countdowns, and killed people over the ICU limit.

_update_countdowns(states)[source]

Update countdowns.

_update_info_on_newly_infected(states, newly_infected_contacts, newly_infected_events, virus_strains)[source]

Update information with newly infected individuals.

_kill_people_over_icu_limit(states, params, seed)[source]

Kill people over the ICU limit.

_update_info_on_new_tests(states: pd.DataFrame, to_be_processed_tests: pd.Series)pd.DataFrame[source]
_update_info_on_new_vaccinations(states: pd.DataFrame, newly_vaccinated: pd.Series)pd.DataFrame[source]

Activate the counter for immunity by vaccinations.

update_derived_state_variables(states, derived_state_variables)[source]