-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f8af7d9
commit 99208a5
Showing
16 changed files
with
335 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# rethrows error correctly from implementation | ||
|
||
Code | ||
params <- extract_parameter_set_dials(rec) | ||
Condition | ||
Error in `mutate()`: | ||
i In argument: `object = purrr::map(call_info, eval_call_info)`. | ||
Caused by error in `purrr::map()`: | ||
i In index: 1. | ||
Caused by error in `.f()`: | ||
! Error when calling `num_comp()`: Error in dials::num_comp(range = c(1L, 4L)) : mocked error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# tune_args() errors on multiple tune()s in same arg | ||
|
||
Code | ||
recipe(~., data = mtcars) %>% step_pca(all_predictors(), num_comp = ~ tune() + | ||
tune()) %>% tune_args() | ||
Condition | ||
Error in `purrr::map()`: | ||
i In index: 1. | ||
Caused by error in `purrr::map_chr()`: | ||
i In index: 1. | ||
i With name: num_comp. | ||
Caused by error in `find_tune_id()`: | ||
! Only one tunable value is currently allowed per argument. The current argument has: tune() + tune(). | ||
|
||
# tune_tbl() errors on duplicate ids | ||
|
||
Code | ||
tune_tbl(name = c("a", "b"), tunable = c(TRUE, TRUE), id = c("a", "a"), source = c( | ||
"a", "b"), component = c("a", "b"), component_id = c("a", "b"), full = TRUE) | ||
Condition | ||
Error in `tune_tbl()`: | ||
! There are duplicate id values listed in `tune()`: "a". | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
test_that("rethrows error correctly from implementation", { | ||
skip_if_not_installed("dials") | ||
rec <- recipe(~., data = mtcars) %>% | ||
step_pca(all_predictors(), num_comp = hardhat::tune()) | ||
|
||
local_mocked_bindings( | ||
.package = "dials", | ||
num_comp = function(...) { | ||
cli::cli_abort("mocked error") | ||
} | ||
) | ||
|
||
expect_snapshot( | ||
error = TRUE, | ||
params <- extract_parameter_set_dials(rec) | ||
) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.