almartin82 / njschooldata

a simple, consistent interface for accessing NJ DOE school data in R
Other
11 stars 4 forks source link

report card tests to investigate #147

Closed almartin82 closed 3 years ago

almartin82 commented 4 years ago
test_report_card.R:37: failure: get_raw_rc_database returns list of data frames
length(many_rc) not equal to 6.
1/1 mismatches
[1] 8 - 6 == 2

test_report_card.R:64: error: extract_rc_ap pulls longitudinal Advanced Placement data
attempt to select less than one element in get1index
1: extract_rc_AP(many_rc) at tests/testthat/test_report_card.R:64
2: map(list_of_prs, function(.x) {
       ap_sum_tables <- grep("ap_sum\\b|ap_ib_sum|apib_test_performance|apib_coursework_part_perf",  at /Users/almartin/Google Drive/repositories/njschooldata/R/report_card.R:475
3: .f(.x[[i]], ...)
4: .x %>% extract2(ap_sum_tables) at /Users/almartin/Google Drive/repositories/njschooldata/R/report_card.R:486
5: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
6: eval(quote(`_fseq`(`_lhs`)), env, env)
7: eval(quote(`_fseq`(`_lhs`)), env, env)
8: `_fseq`(`_lhs`)
9: freduce(value, `_function_list`)
10: withVisible(function_list[[k]](value))
11: function_list[[k]](value)

test_report_card.R:97: failure: extract_rc_enrollment pulls longitudinal enrollment data
Names of `enr_many` ('county_id', 'district_id', 'school_id', 'end_year', 'grade_level', 'n_enrolled', 'county_name', 'district_name') don't match 'county_code', 'district_code', 'school_code', 'end_year', 'grade_level', 'n_enrolled', 'county_name', 'district_name', 'school_name'

test_report_card.R:108: error: extract_rc_enrollment pulls longitudinal enrollment data
object 'district_code' not found
1: expect_equal(enr_many %>% filter(district_code == "3570", school_code == 
       "999", grade_level == "TOTAL", end_year == 2019) %>% pull(n_enrolled),  at tests/testthat/test_report_card.R:108
2: quasi_label(enquo(object), label)
3: eval_bare(get_expr(quo), get_env(quo))
4: enr_many %>% filter(district_code == "3570", school_code == "999", grade_level == 
       "TOTAL", end_year == 2019) %>% pull(n_enrolled)
5: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
6: eval(quote(`_fseq`(`_lhs`)), env, env)
7: eval(quote(`_fseq`(`_lhs`)), env, env)
8: `_fseq`(`_lhs`)
9: freduce(value, `_function_list`)
10: function_list[[i]](value)
11: filter(., district_code == "3570", school_code == "999", grade_level == 
       "TOTAL", end_year == 2019)
12: filter.tbl_df(., district_code == "3570", school_code == "999", grade_level == 
       "TOTAL", end_year == 2019)
13: filter_impl(.data, quo)
14: ~district_code == "3570"

test_report_card.R:130: failure: extract_rc_college_matric ground truth values
`%>%`(...) not equal to 85.3.
1/1 mismatches
[1] 67.2 - 85.3 == -18.1

test_report_card.R:137: failure: extract_rc_college_matric ground truth values
`%>%`(...) not equal to 93.6.
1/1 mismatches
[1] 87.4 - 93.6 == -6.2

test_report_card.R:154: error: enrich_grad_count joins correct years
there is no package called ‘DescTools’
1: matric_13 %>% enrich_grad_count() at tests/testthat/test_report_card.R:154
2: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
3: eval(quote(`_fseq`(`_lhs`)), env, env)
4: eval(quote(`_fseq`(`_lhs`)), env, env)
5: `_fseq`(`_lhs`)
6: freduce(value, `_function_list`)
7: withVisible(function_list[[k]](value))
8: function_list[[k]](value)
9: enrich_grad_count(.)
10: df %>% filter(end_year != 2012) %>% left_join(postsec_rates, by = "end_year") %>% 
       mutate(gc_year = if_else(is_16mo, end_year - 1, as.numeric(end_year))) %>%  at /Users/almartin/Google Drive/repositories/njschooldata/R/grate.R:947
...
18: filter.tbl_df(., enroll_any != DescTools::Mode(enroll_any, na.rm = T))
19: filter_impl(.data, quo)
20: DescTools::Mode
21: getExportedValue(pkg, name)
22: asNamespace(ns)
23: getNamespace(ns)
24: tryCatch(loadNamespace(name), error = function(e) stop(e))
25: tryCatchList(expr, classes, parentenv, handlers)
26: tryCatchOne(expr, names, parentenv, handlers[[1L]])
27: value[[3L]](cond)

test_report_card.R:187: error: enrich_grad_count joins correct subgroup
there is no package called ‘DescTools’
1: matric_13 %>% enrich_grad_count() at tests/testthat/test_report_card.R:187