Location#

class Location(_obj=None, **kwargs)[source]#

Bases: JsonObject

Class for the json object for the location containing data about the population to generate representative contact networks.

The general use case of this is to use a filepath, and the parent data is parsed from the filepath. DefaultProperty type handles either a scalar or json object. We allow a json object mainly for testing of inheriting from a parent specified directly in the json.

Most users will want to populate this with a relative or absolute file path.

Note

The structures for the population age distribution will be updated to be more flexible to take in a parameter for the number of age brackets to generate the population age distribution structure.

Attributes

citations

data_provenance_notices

employment_rates_by_age

enrollment_rates_by_age

household_head_age_brackets

household_head_age_distribution_by_family_size

household_size_distribution

location_name

ltcf_num_residents_distribution

ltcf_num_staff_distribution

ltcf_resident_to_staff_ratio_distribution

ltcf_use_rate_distribution

notes

parent

population_age_distributions

reference_links

school_size_brackets

school_size_distribution

school_size_distribution_by_type

school_types_by_age

workplace_size_counts_by_num_personnel

Methods

get_list_properties()[source]#

Get the properties of the location data object as a list.

Returns:

A list of the properties of the location json object with data about the location.

Return type:

list

get_population_age_distribution(nbrackets)[source]#

Get the age distribution of the population aggregated to nbrackets age brackets. If the data doesn’t contain a distribution with the requested number of brackets, an exception is raised.

Parameters:

nbrackets (int) – the number of age brackets the age distribution is aggregated to

Returns:

A list of the probability age distribution values indexed by the bracket number.

Return type:

list