Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: flepiconfig Test Suite Currently Does Not Pass #350

Open
TimothyWillard opened this issue Oct 18, 2024 · 0 comments
Open

[Bug]: flepiconfig Test Suite Currently Does Not Pass #350

TimothyWillard opened this issue Oct 18, 2024 · 0 comments
Labels
medium priority Medium priority. quick issue Short or easy fix. r-flepiconfig Relating to the R configuration package.

Comments

@TimothyWillard
Copy link
Contributor

Label

flepiconfig, quick issue

Priority Label

medium priority

Describe the bug/issue

The test suite for flepiconfig currently has two failures. Looks like this is a classic geoid vs subpop column naming issue. This is a blocker to integrating flepiconfig into our set of GitHub actions.

To Reproduce

To reproduce:

> getwd()
[1] "/Users/twillard/Desktop/GitHub/HopkinsIDD/flepiMoP/flepimop/R_packages/flepiconfig"
> devtools::test()
ℹ Testing flepiconfig

Attaching package: ‘testthat’

The following object is masked from ‘package:devtools’:

    test_file

✔ | F W  S  OK | Context
✖ | 1        0 | gen_npi
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Error (test-gen_npi.R:97:5): Interventions processing works
<dplyr:::mutate_error/rlang_error/error/condition>
Error in `dplyr::mutate(., geoid = as.character(geoid))`: ℹ In argument: `geoid = as.character(geoid)`.
Caused by error:
! object 'geoid' not found
Backtrace:
     ▆
  1. ├─flepiconfig (local) generate_processed(...) at test-gen_npi.R:97:5
  2. │ └─flepiconfig:::load_geodata_file(filename = geodata_path) at test-gen_npi.R:13:5
  3. │   └─readr::read_csv(filename) %>% ... at flepiconfig/R/process_npi_list.R:25:5
  4. ├─dplyr::mutate(., geoid = as.character(geoid))
  5. ├─dplyr:::mutate.data.frame(., geoid = as.character(geoid))
  6. │ └─dplyr:::mutate_cols(.data, dplyr_quosures(...), by)
  7. │   ├─base::withCallingHandlers(...)
  8. │   └─dplyr:::mutate_col(dots[[i]], data, mask, new_columns)
  9. │     └─mask$eval_all_mutate(quo)
 10. │       └─dplyr (local) eval()
 11. └─base::.handleSimpleError(...)
 12.   └─dplyr (local) h(simpleError(msg, call))
 13.     └─rlang::abort(message, class = error_class, parent = parent, call = error_call)
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✖ | 1        0 | print_config
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Error ('test-print_config.R:73:5'): Config generation works
Error in `print_header(sim_name = "USA", sim_start_date = "2020-01-01",
    sim_end_date = "2021-08-07", dt = 0.25, nslots = 300, modeled_states = unique(interventions$USPS[!interventions$USPS %in%
        c("", "all") & !is.na(interventions$USPS)]), setup_name = "usa_inference_territories_statelevel",
    geodata = "geodata_territories_2019_statelevel.csv", mobility = "mobility_territories_2011-2015_statelevel.csv")`: unused arguments (dt = 0.25, modeled_states = unique(interventions$USPS[!interventions$USPS %in% c("", "all") & !is.na(interventions$USPS)]), geodata = "geodata_territories_2019_statelevel.csv", mobility = "mobility_territories_2011-2015_statelevel.csv")
Backtrace:
    ▆
 1. └─flepiconfig (local) generate_config() at test-print_config.R:73:5
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

══ Results ═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
── Failed tests ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Error ('test-gen_npi.R:97:5'): Interventions processing works
<dplyr:::mutate_error/rlang_error/error/condition>
Error in `dplyr::mutate(., geoid = as.character(geoid))`: ℹ In argument: `geoid = as.character(geoid)`.
Caused by error:
! object 'geoid' not found
Backtrace:
     ▆
  1. ├─flepiconfig (local) generate_processed(...) at test-gen_npi.R:97:5
  2. │ └─flepiconfig:::load_geodata_file(filename = geodata_path) at test-gen_npi.R:13:5
  3. │   └─readr::read_csv(filename) %>% ... at flepiconfig/R/process_npi_list.R:25:5
  4. ├─dplyr::mutate(., geoid = as.character(geoid))
  5. ├─dplyr:::mutate.data.frame(., geoid = as.character(geoid))
  6. │ └─dplyr:::mutate_cols(.data, dplyr_quosures(...), by)
  7. │   ├─base::withCallingHandlers(...)
  8. │   └─dplyr:::mutate_col(dots[[i]], data, mask, new_columns)
  9. │     └─mask$eval_all_mutate(quo)
 10. │       └─dplyr (local) eval()
 11. └─base::.handleSimpleError(...)
 12.   └─dplyr (local) h(simpleError(msg, call))
 13.     └─rlang::abort(message, class = error_class, parent = parent, call = error_call)

Error ('test-print_config.R:73:5'): Config generation works
Error in `print_header(sim_name = "USA", sim_start_date = "2020-01-01",
    sim_end_date = "2021-08-07", dt = 0.25, nslots = 300, modeled_states = unique(interventions$USPS[!interventions$USPS %in%
        c("", "all") & !is.na(interventions$USPS)]), setup_name = "usa_inference_territories_statelevel",
    geodata = "geodata_territories_2019_statelevel.csv", mobility = "mobility_territories_2011-2015_statelevel.csv")`: unused arguments (dt = 0.25, modeled_states = unique(interventions$USPS[!interventions$USPS %in% c("", "all") & !is.na(interventions$USPS)]), geodata = "geodata_territories_2019_statelevel.csv", mobility = "mobility_territories_2011-2015_statelevel.csv")
Backtrace:
    ▆
 1. └─flepiconfig (local) generate_config() at test-print_config.R:73:5

[ FAIL 2 | WARN 0 | SKIP 0 | PASS 0 ]
Warning messages:
1: replacing previous import ‘foreach::when’ by ‘purrr::when’ when loading ‘flepicommon’
2: replacing previous import ‘foreach::accumulate’ by ‘purrr::accumulate’ when loading ‘flepicommon’
> q()
Save workspace image? [y/n/c]: n

Environment, if relevant

MacOS 14.6.1, R 4.3.3, Python 3.10.15, conda 24.5.0

@TimothyWillard TimothyWillard added medium priority Medium priority. quick issue Short or easy fix. r-flepiconfig Relating to the R configuration package. labels Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium priority Medium priority. quick issue Short or easy fix. r-flepiconfig Relating to the R configuration package.
Projects
None yet
Development

No branches or pull requests

1 participant