june.groups.company

exception june.groups.company.CompanyError
__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args
class june.groups.company.Companies(companies: List[Companies])

Create companies and provide functionality to allocate workers.

company_size_per_superarea_df: pd.DataFram

Nr. of companies within a size-range per SuperArea.

compsec_per_msoa_df: pd.DataFrame

Nr. of companies per sector sector per SuperArea.

__init__(companies: List[Companies])

Create companies and provide functionality to allocate workers.

company_size_per_superarea_df: pd.DataFram

Nr. of companies within a size-range per SuperArea.

compsec_per_msoa_df: pd.DataFrame

Nr. of companies per sector sector per SuperArea.

_make_member_ids_dict(members)

Makes a dictionary with the ids of the members.

add(group)
clear()
classmethod create_companies_in_super_area(super_area: june.geography.geography.SuperArea, company_sizes, company_sectors) → list

Crates companies in super area using the sizes and sectors distributions.

classmethod create_company(super_area, company_size, company_sector)
classmethod for_box_mode()
classmethod for_geography(geography: june.geography.geography.Geography, size_nr_file: str = PosixPath('/home/sadie/JUNE/data/input/companies/company_size_2019.csv'), sector_nr_per_msoa_file: str = PosixPath('/home/sadie/JUNE/data/input/companies/company_sector_2011.csv'), default_config_filename: str = PosixPath('/home/sadie/JUNE/configs/defaults/groups/companies.yaml'))june.groups.company.Companies

Creates companies for the specified geography, and saves them to the super_aresa they belong to Parameters ———- geography

an instance of the geography class

company_size_per_superarea_filename:

Nr. of companies within a size-range per SuperArea.

compsec_per_msoa_filename:

Nr. of companies per sector sector per SuperArea.

classmethod for_super_areas(super_areas: List[june.geography.geography.SuperArea], size_nr_per_super_area_file: str = PosixPath('/home/sadie/JUNE/data/input/companies/company_size_2019.csv'), sector_nr_per_super_area_file: str = PosixPath('/home/sadie/JUNE/data/input/companies/company_sector_2011.csv'), default_config_filename: str = PosixPath('/home/sadie/JUNE/configs/defaults/groups/companies.yaml'))june.groups.company.Companies

Creates companies for the specified super_areas, and saves them to the super_aresa they belong to Parameters ———- super_areas

list of super areas

company_size_per_superarea_filename:

Nr. of companies within a size-range per SuperArea.

compsec_per_msoa_filename:

Nr. of companies per industry sector per SuperArea.

classmethod from_file()
get_from_id(id)
get_spec() → str

Returns the speciailization of the super group.

property group_spec
property member_ids
class june.groups.company.Company(super_area=None, n_workers_max=inf, sector=None)

The Company class represents a company that contains information about its workers which are not yet distributed to key company sectors (e.g. as schools and hospitals).

Currently we treat the workforce of a company as one single sub-group and therefore we invoke the base class group with the default Ngroups = 1. We made this explicit here, although it is not necessary.

A group of people such as in a hospital or a school.

If a spec attribute is not defined in the child class then it is generated by converting the class name into snakecase.

class SubgroupType(value)

An enumeration.

workers = 0
__init__(super_area=None, n_workers_max=inf, sector=None)

A group of people such as in a hospital or a school.

If a spec attribute is not defined in the child class then it is generated by converting the class name into snakecase.

_collate_from_subgroups(attribute: str) → List[june.demography.person.Person]

Return a set of all of the people in the subgroups with a particular health status

attribute

The name of the attribute in the subgroup, e.g. “in_hospital”

The union of all the sets with the given attribute name in all of the sub groups.

classmethod _next_id() → int

Iterate an id for this class. Each group class has its own id iterator starting at 0

add(person)

Add a person to a given subgroup. For example, in a school a student is added to the subgroup matching their age.

person

A person

group_type

clear()
get_spec() → str

Returns the speciailization of the group.

remove_person(person: june.demography.person.Person)

Remove a person from this group by removing them from the subgroup to which they belong

person

A person

_abc_impl = <_abc_data object>
property area
property contains_people

Does this group contain at least one person?

property coordinates
property dead
external = False
id
property in_hospital
property infected
property must_timestep
property n_workers
n_workers_max
property name

The name is computed on the fly to reduce memory footprint. It combines the name fo the class with the id of the instance.

property people

All the people in this group

property recovered
sector
property size
property size_infected
property size_recovered
property size_susceptible
spec
subgroups
super_area
property susceptible
property workers
june.groups.company._get_size_brackets(sizegroup: str)

Given company size group calculates mean