def test_with_ltcf(self): """ test with long term care facilities options """ rand_seed = 1 sp.set_seed(rand_seed) # set param n = self.n datadir = self.dataDir location = 'seattle_metro' state_location = 'Washington' country_location = 'usa' sheet_name = 'United States of America' use_two_group_reduction = True average_LTCF_degree = 20 ltcf_staff_age_min = 20 ltcf_staff_age_max = 65 with_school_types = True average_class_size = 20 inter_grade_mixing = 0.1 average_student_teacher_ratio = 20.0 average_teacher_teacher_degree = 3 teacher_age_min = 25 teacher_age_max = 70 with_non_teaching_staff = True average_student_all_staff_ratio = 11 average_additional_staff_degree = 20 staff_age_min = 20 staff_age_max = 75 school_mixing_type = {'pk': 'age_and_class_clustered', 'es': 'random', 'ms': 'age_clustered', 'hs': 'random', 'uv': 'random'} return_popdict = True vals = locals() test_prefix = sys._getframe().f_code.co_name pop = utilities.runpop(resultdir=self.resultdir, testprefix=test_prefix, actual_vals=vals, method=None) if self.do_plot: utilities.check_class_size(pop, average_class_size, average_student_teacher_ratio, average_student_all_staff_ratio, 1) result = utilities.check_teacher_staff_ratio(pop, datadir, test_prefix, average_student_teacher_ratio, average_student_all_staff_ratio, err_margin=2) utilities_dist.check_age_distribution(pop, self.n, datadir, self.resultdir, location, state_location, country_location, test_prefix=test_prefix, do_close=self.do_close) utilities_dist.check_enrollment_distribution(pop, self.n, datadir, self.resultdir, location, state_location, country_location, test_prefix=test_prefix, do_close=self.do_close)
def test_staff_generate(self): """ generate a population and check if teacher/staff ratio match """ rand_seed = 1 sp.set_seed(rand_seed) #set param n = self.n datadir = self.dataDir location = 'seattle_metro' state_location = 'Washington' country_location = 'usa' sheet_name = 'United States of America' school_enrollment_counts_available = False with_school_types = False school_mixing_type = 'random' average_class_size = 20 inter_grade_mixing = 0.1 average_student_teacher_ratio = 20 average_teacher_teacher_degree = 3 teacher_age_min = 25 teacher_age_max = 75 average_student_all_staff_ratio = 12 average_additional_staff_degree = 18 staff_age_min = 20 staff_age_max = 75 return_popdict = True test_prefix = sys._getframe().f_code.co_name vals = locals() pop = utilities.runpop(resultdir=self.resultdir, testprefix=f"{test_prefix}", actual_vals=vals, method=sp.generate_synthetic_population) if self.do_plot: utilities.check_class_size(pop, average_class_size, average_student_teacher_ratio, average_student_all_staff_ratio, 1) result = utilities.check_teacher_staff_ratio(pop, self.dataDir, f"{test_prefix}", average_student_teacher_ratio, average_student_all_staff_ratio, err_margin=2) utilities_dist.check_age_distribution(pop, self.n, datadir, self.resultdir, location, state_location, country_location, test_prefix=test_prefix, do_close=self.do_close) utilities_dist.check_enrollment_distribution(pop, self.n, datadir, self.resultdir, location, state_location, country_location, test_prefix=f"{test_prefix}", do_close=self.do_close)