-
Notifications
You must be signed in to change notification settings - Fork 48
log a backtrace for tuning issues #879
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -307,8 +307,10 @@ log_problems <- function(notes, control, split, loc, res, bad_only = FALSE) { | |
| wrn_msg <- unique(wrn_msg) | ||
| wrn_msg <- paste(wrn_msg, collapse = ", ") | ||
|
|
||
| wrn_traces <- purrr::map(wrn, `$`, "trace") | ||
|
|
||
| wrn_msg <- tibble::new_tibble( | ||
| list(location = loc, type = "warning", note = wrn_msg), | ||
| list(location = loc, type = "warning", note = wrn_msg, trace = list(wrn_traces[[1]])), | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that traces are a tibble subclass. Each row in the output of this function is a given place in evaluating a resample fold, e.g. It's possible to have more than one warning appear in a given model fit or prediction or metric calculation, so we collapse messages (see above) into one string in that case. For traces, we could just pass all of Said another way, right now, to extract the second logged trace, you could write This approach banks on the fact that it's likely not useful to have a backtrace for each warning that occurs in a single call to e.g.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd go with clarity over completeness here and only use the first trace as suggested. If we later realize that this does not get us to a useful debugging point often enough, we can still extend it. |
||
| nrow = 1 | ||
| ) | ||
|
|
||
|
|
@@ -322,15 +324,16 @@ log_problems <- function(notes, control, split, loc, res, bad_only = FALSE) { | |
| } | ||
| } | ||
| if (inherits(res$res, "try-error")) { | ||
| err_cnd <- attr(res$res, "condition") | ||
| if (should_catalog) { | ||
| err_msg <- conditionMessage(attr(res$res, "condition")) | ||
| err_msg <- conditionMessage(err_cnd) | ||
| } else { | ||
| err_msg <- as.character(attr(res$res, "condition")) | ||
| err_msg <- as.character(err_cnd) | ||
| err_msg <- gsub("\n$", "", err_msg) | ||
| } | ||
|
|
||
| err_msg <- tibble::new_tibble( | ||
| list(location = loc, type = "error", note = err_msg), | ||
| list(location = loc, type = "error", note = err_msg, trace = list(err_cnd$trace)), | ||
| nrow = 1 | ||
| ) | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.