june.distributors.worker_distributor.WorkerDistributor¶
-
class
june.distributors.worker_distributor.
WorkerDistributor
(workflow_df: pandas.core.frame.DataFrame, sex_per_sector_df: pandas.core.frame.DataFrame, company_closure: dict, age_range: List[int], sub_sector_ratio: dict, sub_sector_distr: dict, non_geographical_work_location: dict) This class distributes people to their work. Work is understood as the main activity any individuum pursues during the week, e.g. for pupils it is learning in schools and for adults it is their work in companies and key sectors for which data was provided.
- workflow_df
DataFrame that contains information about where man and woman go to work with respect to their SuperArea of residence.
- sector_by_sex_df
DataFrame that contains information on the nr. of man and woman working in different sectors per Area (note that it is thus not provided for the SuperArea).
- sub_sector_ratio
For each region containing the ratio of man and woman respectively that work in any key sector type. (e.g. for healthcare, how many man work in the key occupations, such as nurses within that sector)
- sub_sector_distr
For each region containing how many of man and woman respectively work in any key sector jobs, such as primary teachers or medical practitioners.
- non_geographical_work_location:
Special work place locations in dataset that do not correspond to a SuperArea name but to special cases such as: “home”, “oversea”, “offshore”, … They are the key of the dictionary. The value carries the action on what should be done with these workers. Currently they are: “home”: let them work from home “bind”: randomly select a SuperArea to send the worker to work in
- company_closure:
Proportion of each company sector who will be defined as a key worker, become furloughed of will randomly assigned to go to work during a lockdown
-
__init__
(workflow_df: pandas.core.frame.DataFrame, sex_per_sector_df: pandas.core.frame.DataFrame, company_closure: dict, age_range: List[int], sub_sector_ratio: dict, sub_sector_distr: dict, non_geographical_work_location: dict) - workflow_df
DataFrame that contains information about where man and woman go to work with respect to their SuperArea of residence.
- sector_by_sex_df
DataFrame that contains information on the nr. of man and woman working in different sectors per Area (note that it is thus not provided for the SuperArea).
- sub_sector_ratio
For each region containing the ratio of man and woman respectively that work in any key sector type. (e.g. for healthcare, how many man work in the key occupations, such as nurses within that sector)
- sub_sector_distr
For each region containing how many of man and woman respectively work in any key sector jobs, such as primary teachers or medical practitioners.
- non_geographical_work_location:
Special work place locations in dataset that do not correspond to a SuperArea name but to special cases such as: “home”, “oversea”, “offshore”, … They are the key of the dictionary. The value carries the action on what should be done with these workers. Currently they are: “home”: let them work from home “bind”: randomly select a SuperArea to send the worker to work in
- company_closure:
Proportion of each company sector who will be defined as a key worker, become furloughed of will randomly assigned to go to work during a lockdown
-
_assign_lockdown_status
(probabilities_by_sector: dict, lockdown_tags: List[str], lockdown_tags_idx: List[int], person: june.demography.person.Person) Assign lockdown_status in proportion to definitions in the policy config
-
_assign_sub_sector
(person) Assign sub-sector job as defined in config
-
_assign_work_location
(i: int, person: june.demography.person.Person, wf_area_df: pandas.core.frame.DataFrame) Employ people in any given sector.
-
_assign_work_sector
(i: int, person: june.demography.person.Person) Employ people in a given SuperArea.
-
_lockdown_status_lottery
(n_workers) Creates run-once random list for each person in an area for assigning to a lockdown status
-
_parse_closure_probabilities_by_sector
(company_closure: dict, lockdown_tags: List) parses config file of closure probabilities
-
_select_rnd_superarea
(person: june.demography.person.Person) Selects random SuperArea to send a worker to work in
-
_work_place_lottery
(area_name: str, wf_area_df: pandas.core.frame.DataFrame, n_workers: int) Create lottery that randomly assigns people a sector and location of work.
-
distribute
(areas: june.geography.geography.Areas, super_areas: june.geography.geography.SuperAreas, population: june.demography.demography.Population) Assign any person within the eligible working age range a location (SuperArea) of their work, and the sector (e.g. “P”=education) of their work.
-
classmethod
for_geography
(geography: june.geography.geography.Geography, workflow_file: str = PosixPath('/home/sadie/JUNE/data/input/work/work_flow.csv'), sex_per_sector_file: str = PosixPath('/home/sadie/JUNE/data/input/work/industry_by_sex_ew.csv'), config_file: str = PosixPath('/home/sadie/JUNE/configs/defaults/distributors/worker_distributor.yaml'), policy_config_file: str = PosixPath('/home/sadie/JUNE/configs/defaults/policy/company_closure.yaml')) → june.distributors.worker_distributor.WorkerDistributor - geography
an instance of the geography class
-
classmethod
for_super_areas
(area_names: List[str], workflow_file: str = PosixPath('/home/sadie/JUNE/data/input/work/work_flow.csv'), sex_per_sector_file: str = PosixPath('/home/sadie/JUNE/data/input/work/industry_by_sex_ew.csv'), config_file: str = PosixPath('/home/sadie/JUNE/configs/defaults/distributors/worker_distributor.yaml'), policy_config_file: str = PosixPath('/home/sadie/JUNE/configs/defaults/policy/company_closure.yaml')) → june.distributors.worker_distributor.WorkerDistributor
-
classmethod
for_zone
(filter_key: Dict[str, list], areas_maps_path: str = PosixPath('/home/sadie/JUNE/data/input/geography/area_super_area_region.csv'), workflow_file: str = PosixPath('/home/sadie/JUNE/data/input/work/work_flow.csv'), sex_per_sector_file: str = PosixPath('/home/sadie/JUNE/data/input/work/industry_by_sex_ew.csv'), config_file: str = PosixPath('/home/sadie/JUNE/configs/defaults/distributors/worker_distributor.yaml'), policy_config_file: str = PosixPath('/home/sadie/JUNE/configs/defaults/policy/company_closure.yaml')) → june.distributors.worker_distributor.WorkerDistributor filter_key = {“region” : “North East”} filter_key = {“super_area” : [“EXXXX”, “EYYYY”]}
-
classmethod
from_file
(area_names: Optional[List[str]] = None, workflow_file: str = PosixPath('/home/sadie/JUNE/data/input/work/work_flow.csv'), sex_per_sector_file: str = PosixPath('/home/sadie/JUNE/data/input/work/industry_by_sex_ew.csv'), config_file: str = PosixPath('/home/sadie/JUNE/configs/defaults/distributors/worker_distributor.yaml'), policy_config_file: str = PosixPath('/home/sadie/JUNE/configs/defaults/policy/company_closure.yaml')) → june.distributors.worker_distributor.WorkerDistributor - area_names
List of SuperArea names for which to initiate WorkerDistributor
- workflow_file
Filename to data containing information about where man and woman go to work with respect to their SuperArea of residence.
sex_per_sector_file education_sector_file healthcare_sector_file