sid.events

This module contains the code to calculate infections by events.

Module Contents

Functions

calculate_infections_by_events(states, params, events, virus_strains, seed)

Apply events to states and return indicator for infections.

calculate_infections_by_events(states, params, events, virus_strains, seed)[source]

Apply events to states and return indicator for infections.

Each event is evaluated which yields a collection of series with indicators for infected people. All events are merged with the logical OR.

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

  • params (pandas.DataFrame) – See params.

  • events (dict) – Dictionary of events which cause infections.

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

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

Returns

Series marking individuals who have been

infected through an event. The index is the same as states, values are boolean. True marks individuals infected by an event.

Return type

newly_infected_events (pandas.Series)