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

Deal with dist_quantiles() CHECK issue #631

Open
brookslogan opened this issue Mar 13, 2025 · 2 comments · May be fixed by #634
Open

Deal with dist_quantiles() CHECK issue #631

brookslogan opened this issue Mar 13, 2025 · 2 comments · May be fixed by #634
Assignees

Comments

@brookslogan
Copy link
Contributor

  • address the deprecation, migrating to hardhat fn
  • address the error if it persists after migration
── Warning ('test-compactify.R:124:3'): compactify works on distributions ──────
`dist_quantiles()` was deprecated in epipredict 0.1.11.
i Please use `hardhat::quantile_pred()` instead.
Backtrace:
    ▆
 1. ├─tibble::tibble(...) at test-compactify.R:124:3
 2. │ └─tibble:::tibble_quos(xs, .rows, .name_repair)
 3. │   └─rlang::eval_tidy(xs[[j]], mask)
 4. └─epipredict::dist_quantiles(c(3, 5, 9), c(0.2, 0.5, 0.8))

══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-compactify.R:124:3'): compactify works on distributions ────────
<vctrs_error_ptype2/vctrs_error_incompatible_type/vctrs_error_incompatible/vctrs_error/rlang_error/error/condition>
Error in `vec_c(...)`: Can't combine `..1` <quantiles> and `..4` <distribution>.
Backtrace:
     ▆
  1. ├─tibble::tibble(...) at test-compactify.R:124:3
  2. │ └─tibble:::tibble_quos(xs, .rows, .name_repair)
  3. │   └─rlang::eval_tidy(xs[[j]], mask)
  4. ├─base::c(...)
  5. ├─vctrs:::c.vctrs_vctr(...)
  6. │ └─vctrs::vec_c(...)
  7. └─vctrs (local) `<fn>`()
  8.   └─vctrs::vec_default_ptype2(...)
  9.     ├─base::withRestarts(...)
 10.     │ └─base (local) withOneRestart(expr, restarts[[1L]])
 11.     │   └─base (local) doWithOneRestart(return(expr), restart)
 12.     └─vctrs::stop_incompatible_type(...)
 13.       └─vctrs:::stop_incompatible(...)
 14.         └─vctrs:::stop_vctrs(...)
 15.           └─rlang::abort(message, class = c(class, "vctrs_error"), ..., call = call)

[ FAIL 1 | WARN 7 | SKIP 0 | PASS 1340 ]
Error: Error: Test failures
Execution halted

2 errors ✖ | 1 warning ✖ | 1 note ✖
Error: Process completed with exit code 1.
@brookslogan brookslogan mentioned this issue Mar 17, 2025
4 tasks
@brookslogan brookslogan self-assigned this Mar 18, 2025
@brookslogan
Copy link
Contributor Author

brookslogan commented Mar 18, 2025

Unfortunately, hardhat::quantile_pred() doesn't seem to cleanly support vec_c with NA in downstream ops, unlike the old backend of dist_quantiles() (though in tests, I have some explicit distributional::dist_missing call... did vec_c also have issues with casting NA there? I don't know if there's any equivalent to that in hardhat though). I can't immediately tell if this is a hardhat issue or vctrs issue, and am trying to work through trouble installing winch for more details / bug filing.

@brookslogan
Copy link
Contributor Author

brookslogan commented Mar 19, 2025

  • The test needs updated to directly use pred_quantiles(), not use dist_missing(), and to not have level-changing.
  • Add specialized epix_slide for epi_slide_opt #611 appears to incidentally deal with as_epi_archive() running into issues due to dplyr::lag() creating a not-well-handled NA.
  • Need to report these NA issues upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant