data#

Classes

Location

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

PopulationAgeDistribution

Class for population age distribution with a specified number of bins.

SchoolSizeDistributionByType

Class for the school size distribution by school type.

SchoolTypeByAge

Class for the school type by age range.

Functions

are_location_constraints_satisfied

Checks a number of constraints that need to be satisfied for the schema.

check_all_probability_distribution_nonnegative

Run checks that a field representing probabilty distributions has all non negative values.

check_all_probability_distribution_sums

Checks that each probability distribution available to a location has a sum close to 1.

check_array_of_array_entry_lens_arr

check_array_of_arrays_entry_lens

Check that each array in an array of arrays has the expected length.

check_employment_rates_by_age

Check that the employment rates by age is an array of arrays, where each sub array has length 2.

check_enrollment_rates_by_age

Check that the enrollment rates by age is an array of arrays, where each sub array has length 2.

check_household_head_age_brackets

Check that the household head age brackets is an array of arrays, where each sub array has length 2.

check_household_head_age_distributions_by_family_size

Check that the conditional household head age distribution by household size is an array with length equal to the number of household head age brackets.

check_household_size_distribution

Check that the household size distribution is an array of arrays, where each sub array has length 2.

check_location_constraints_satisfied

Checks a number of constraints that need to be satisfied for the schema.

check_location_name

Check the location json data object has a string.

check_ltcf_num_residents_distribution

Check that the long term care facility resident size distribution is an array of arrays, where each sub array has length 3.

check_ltcf_num_staff_distribution

Check that the long term care facility staff size distribution is an array of arrays, where each sub array has length 3.

check_ltcf_resident_to_staff_ratio_distribution

Check that the long term care facility resident to staff ratio distribution is an array of arrays, where each sub array has length 3.

check_population_age_distributions

Check that the population age distributions are self-consistent in the number of brackets, and each sub array has length 3.

check_probability_distribution_nonnegative

Check that fields representing probability distributions have all non negative values.

check_probability_distribution_nonnegative_age_distributions

Check that each population age distribution has all non negative values.

check_probability_distribution_sum

Check that fields representing probability distributions have sums equal to 1 within some tolerance.

check_probability_distribution_sum_age_distributions

Check that each population age distribution has a sum equal to 1 within some tolerance.

check_school_size_brackets

Check that the school size distribution brackets is an array of arrays, where each sub array has length 2.

check_school_size_distribution

check_school_size_distribution_by_type

Check that the school size distribution by school type is an array of arrays, where each sub array has length 3.

check_school_types_by_age

Check that the school types by age range is an array of arrays, where each sub array has length 2.

check_valid_probability_distributions

Check that the property_name is a valid probability distribution.

check_workplace_size_counts_by_num_personnel

Check that the workplace size count is an array of arrays, where each sub array has length 3.

convert_df_to_json_array

Convert desired data from a pandas dataframe into a json array.

get_location_attr

Get the attribute from the json object containing location data given the associated property name.

get_relative_path

Get the relative path for the data folder.

load_location_from_filepath

Loads location data object from provided relative filepath where the file path is relative to defaults.settings.datadir.

load_location_from_json

Load location data from json object with some checks made.

load_location_from_json_str

Load location data from json str with some checks made.

populate_parent_data

Populate location json object with fields from the parent location if available.

populate_parent_data_from_file_path

Loading a location json object with necessary data fields filled from the parent location using the parent location file path.

populate_parent_data_from_json_obj

Loading a location json object with necessary data fields filled from the parent location json.

save_location_to_filepath

Saves json object with location data to provided absolute filepath.