-
Notifications
You must be signed in to change notification settings - Fork 8
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
check compatibility of initial
and param_info
#97
Conversation
R/sim_anneal_helpers.R
Outdated
@@ -144,11 +144,31 @@ random_real_neighbor <- function(current, hist_values, pset, retain = 1, | |||
|
|||
encode_set_backwards <- function(x, pset, ...) { | |||
pset <- pset[pset$id %in% names(x), ] | |||
new_vals <- purrr::map2(pset$object, x, dials::encode_unit, direction = "backward") | |||
new_vals <- mapply(encode_unit_backwards, pset$object, x, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Transitioned to mapply()
so that we don't get purrr's Error in index i, caused by [call we can't control]
rethrown error formatting.
} | ||
|
||
set.seed(1) | ||
expect_snapshot(error = TRUE, transform = scrub_best, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I didn't know about transform
.
* clarify name of helper * include parameter id in error message
Closes #59. This code just reproduces the portion of
dials::encode_unit()
methods that picks up on this discrepancy and gives it a more context-specific message.Created on 2024-01-16 with reprex v2.0.2
I've situated this solution so that it only applies to
tune_sim_anneal()
astune_bayes()
is able to handle that difference just fine.