synthpops.schools module¶
This module generates school contacts by class and grade in flexible ways. Contacts can be clustered into classes and also mixed across the grade and across the school.
H. Guclu et. al (2016) shows that mixing across grades is low for public schools in elementary and middle schools. Mixing across grades is however higher in high schools.
Functions in this module are flexible to allow users to specify the inter-grade mixing (for ‘age_clustered’ school_mixing_type), and to choose whether contacts are clustered within a grade. Clustering contacts across different grades is not supported because there is no data to suggest that this happens commonly.
-
synthpops.schools.
get_school_type_labels
()¶
-
synthpops.schools.
get_enrollment_by_school_type
(popdict, **kwargs)¶ Get enrollment sizes by school types in popdict.
- Parameters
popdict (dict) – population dictionary
**with_school_types (bool) – If True, return enrollment by school types as defined in the popdict. Otherwise, combine all enrollment sizes for a school type of None.
**keys_to_exclude (list) – school types to exclude
- Returns
Dictionary of generated enrollment sizes by school type.
- Return type
dict
-
synthpops.schools.
get_generated_school_size_distributions
(enrollment_by_school_type, bins)¶ Get school size distributions by type.
- Parameters
enrollment_by_school_type (dict) – generated enrollment sizes by school types
bins (list) – school size bins
- Returns
Dictionary of generated school size distribution by school type.
- Return type
dict
-
synthpops.schools.
get_bin_edges
(size_brackets)¶ Get the bin edges for size brackets.
- Parameters
size_brackets (dict) – dictionary mapping bracket or bin number to an array of the range of sizes
- Returns
An array of the bin edges.
-
synthpops.schools.
get_bin_labels
(size_brackets)¶ Get the bin labels from the values contained within each bracket or bin.
- Parameters
size_brackets (dict) – dictionary mapping bracket or bin number to an array of the range of sizes
- Returns
A list of bin labels.