june.logger.read_logger.ReadLogger¶
-
class
june.logger.read_logger.
ReadLogger
(output_path: str = 'results', root_output_file: str = 'logger', n_processes: int = 1) Read hdf5 file saved by the logger, and produce useful data frames
- output_path:
path to simulation’s output
- root_output_path:
name of file saved by simulation
-
__init__
(output_path: str = 'results', root_output_file: str = 'logger', n_processes: int = 1) Read hdf5 file saved by the logger, and produce useful data frames
- output_path:
path to simulation’s output
- root_output_path:
name of file saved by simulation
-
_load_infected_data_for_rank
(rank: int) Load data on infected people over time and convert to a list of data frames
self.infections_per_super_area
-
_load_infection_location_for_rank
(rank: int) → pandas.core.frame.DataFrame Load data frame with informtion on where did people get infected
data frame with infection locations, and average count of infections per group type
-
age_summary
(age_ranges: List[int]) → pandas.core.frame.DataFrame Generate a summary per age range, on how many people are recovered, dead, infected, susceptible, hospitalised or in intensive care, per time step.
- age_ranges:
list of ages that determine the boundaries of the bins. Example: [0,5,10,100] -> Bins : [0,4] , [5,9], [10,99]
A data frame whose index is the date recorded, and columns are super area, number of recovered, dead, infected…
-
draw_symptom_trajectories
(window_length: int = 50, n_people: int = 4) → pandas.core.frame.DataFrame Get data frame with symptoms trajectories of n_people random people that are infected in a time window starting at a random time and recording for
window_length
time steps- window_lengh:
number of time steps to record
- n_people:
number of random infected people to follow
data frame summarising people’s trajectories identified by their id
-
get_config
()
-
get_location_infections_timeseries
(start_date=None, end_date=None) Get a data frame timeseries with the number of infection happening at each type of place, within the given time period
- start_date:
first date to count
- end_date:
last date to count
-
get_locations_infections
(start_date=None, end_date=None) → pandas.core.frame.DataFrame Get a data frame with the number of infection happening at each type of place, within the given time period
- start_date:
first date to count
- end_date:
last date to count
-
get_meta_info
(parameters=None)
-
get_parameters
(parameters=None, max_depth=8) Get the parameters which are stored in the logger.
- parameters:
which parameters to recover. default [“beta”, “alpha_physical”, “infection_seed”, “asyptomatic_ratio”].
- max_depth:
maximum nested dictionary depth to stop searching. Default = 8.
- Returns
nested dictionary of parameters the simulation was run with.
-
get_r
() → pandas.core.frame.DataFrame Get R value as a function of time
data frame with R value, date as index
-
load_hospital_capacity
() → pandas.core.frame.DataFrame Load data on variation of number of patients in hospitals over time
data frame indexed by time stamp
-
load_hospital_characteristics
() → pandas.core.frame.DataFrame Get data frame with the coordinates of all hospitals in the world, and their number of beds
data frame indexed by the hospital id
-
load_infected_data
()
-
load_infection_location
() → pandas.core.frame.DataFrame
-
load_population_data
() Load data related to population (age, sex, …)
-
process_symptoms
(symptoms_df: pandas.core.frame.DataFrame, n_people: int) → pandas.core.frame.DataFrame Given a dataframe with time stamp and a list of symptoms representing the symptoms of every infected person, produce a summary with the number of recovered, dead, infected, susceptible and hospitalised people
- symptoms_df:
data frame with a list of symptoms per time step
- n_people:
number of total people (including susceptibles)
A data frame whose index is the date recorded, and columns are number of recovered, dead, infected…
-
region_summary
() → pandas.core.frame.DataFrame Generate a summary for regions, on how many people are recovered, dead, infected, susceptible, hospitalised or in intensive care, per time step. Returns ——- A data frame whose index is the date recorded, and columns are regions, number of recovered, dead, infected…
-
repack_dict
(hdf5_obj, output_dict, base_path, output_name=None, depth=0, max_depth=8) Pack datesets into a (nested) dictionary.
- hdf5_obj
an open hdf5 object.
- output_dict
an empty dictionary to store output data in
- base_path
the path to start at
-
run_summary
()
-
super_area_summary
() → pandas.core.frame.DataFrame Generate a summary for super areas, on how many people are recovered, dead, infected, susceptible, hospitalised or in intensive care, per time step.
A data frame whose index is the date recorded, and columns are super area, number of recovered, dead, infected…
-
super_areas_to_region_mapping
(super_areas, super_area_region_path=PosixPath('/home/sadie/JUNE/data/input/geography/area_super_area_region.csv'))
-
world_summary
() → pandas.core.frame.DataFrame Generate a summary at the world level, on how many people are recovered, dead, infected, susceptible, hospitalised or in intensive care, per time step.
A data frame whose index is the date recorded, and columns are number of recovered, dead, infected…