Skip to content

Commit

Permalink
merge pr #107: bump tune remote
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch authored Mar 20, 2024
2 parents c127f2e + 813a674 commit e4c78d5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
4 changes: 1 addition & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ URL: https://github.com/tidymodels/finetune,
BugReports: https://github.com/tidymodels/finetune/issues
Depends:
R (>= 3.5),
tune (>= 1.1.2.9020)
tune (>= 1.2.0)
Imports:
cli,
dials (>= 0.1.0),
Expand Down Expand Up @@ -49,8 +49,6 @@ Suggests:
spelling,
testthat,
yardstick
Remotes:
tidymodels/tune
Config/Needs/website: tidyverse/tidytemplate
Config/testthat/edition: 3
Encoding: UTF-8
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-anova-overall.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test_that("formula interface", {
)
})
expect_equal(class(res), c("tune_race", "tune_results", "tbl_df", "tbl", "data.frame"))
expect_true(nrow(collect_metrics(res)) < nrow(grid_mod) * 2)
expect_true(nrow(collect_metrics(res)) < nrow(grid_mod) * 3)
expect_equal(res, .Last.tune.result)
expect_null(.get_tune_eval_times(res))
expect_null(.get_tune_eval_time_target(res))
Expand All @@ -34,7 +34,7 @@ test_that("recipe interface", {
)
})
expect_equal(class(res), c("tune_race", "tune_results", "tbl_df", "tbl", "data.frame"))
expect_true(nrow(collect_metrics(res)) < nrow(grid_mod) * 2)
expect_true(nrow(collect_metrics(res)) < nrow(grid_mod) * 3)
expect_equal(res, .Last.tune.result)
})

Expand All @@ -54,7 +54,7 @@ test_that("variable interface", {
)
})
expect_equal(class(res), c("tune_race", "tune_results", "tbl_df", "tbl", "data.frame"))
expect_true(nrow(collect_metrics(res)) < nrow(grid_mod) * 2)
expect_true(nrow(collect_metrics(res)) < nrow(grid_mod) * 3)
expect_equal(res, .Last.tune.result)
})

Expand Down
14 changes: 7 additions & 7 deletions tests/testthat/test-sa-overall.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ test_that("formula interface", {
)
})
expect_equal(class(res), c("iteration_results", "tune_results", "tbl_df", "tbl", "data.frame"))
expect_true(nrow(collect_metrics(res)) == 6)
expect_true(nrow(collect_metrics(res)) == 9)
expect_equal(res, .Last.tune.result)
expect_null(.get_tune_eval_times(res))
expect_null(.get_tune_eval_time_target(res))
Expand All @@ -32,7 +32,7 @@ test_that("recipe interface", {
})

expect_equal(class(res), c("iteration_results", "tune_results", "tbl_df", "tbl", "data.frame"))
expect_true(nrow(collect_metrics(res)) == 6)
expect_true(nrow(collect_metrics(res)) == 9)
expect_equal(res, .Last.tune.result)
})

Expand All @@ -49,7 +49,7 @@ test_that("variable interface", {
)
})
expect_equal(class(res), c("iteration_results", "tune_results", "tbl_df", "tbl", "data.frame"))
expect_true(nrow(collect_metrics(res)) == 6)
expect_true(nrow(collect_metrics(res)) == 9)
expect_equal(res, .Last.tune.result)

# Check to see if iterations are picked up when an iterative object is used
Expand All @@ -63,9 +63,9 @@ test_that("variable interface", {
control = control_sim_anneal(verbose = FALSE)
)
})
expect_true(nrow(collect_metrics(new_res)) == 10)
expect_true(nrow(collect_metrics(new_res)) == 15)
expect_true(max(new_res$.iter) == 4)
expect_true(sum(grepl("^initial", collect_metrics(new_res)$.config)) == 6)
expect_true(sum(grepl("^initial", collect_metrics(new_res)$.config)) == 9)
expect_equal(new_res, .Last.tune.result)

# but not for non-iterative objects
Expand All @@ -81,9 +81,9 @@ test_that("variable interface", {
control = control_sim_anneal(verbose = FALSE)
)
})
expect_true(nrow(collect_metrics(new_new_res)) == 8)
expect_true(nrow(collect_metrics(new_new_res)) == 12)
expect_true(max(new_new_res$.iter) == 2)
expect_true(sum(grepl("^initial", collect_metrics(new_new_res)$.config)) == 4)
expect_true(sum(grepl("^initial", collect_metrics(new_new_res)$.config)) == 6)
expect_equal(new_new_res, .Last.tune.result)
})

Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-win-loss-overall.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test_that("formula interface", {
})

expect_equal(class(res), c("tune_race", "tune_results", "tbl_df", "tbl", "data.frame"))
expect_true(nrow(collect_metrics(res)) == 10) # this run has no elimination
expect_true(nrow(collect_metrics(res)) == 15) # this run has no elimination
expect_equal(res, .Last.tune.result)
})

Expand Down Expand Up @@ -46,7 +46,7 @@ test_that("variable interface", {
)
})
expect_equal(class(res), c("tune_race", "tune_results", "tbl_df", "tbl", "data.frame"))
expect_true(nrow(collect_metrics(res)) == 10) # no elimination
expect_true(nrow(collect_metrics(res)) == 15) # no elimination
expect_equal(res, .Last.tune.result)
})

Expand Down

0 comments on commit e4c78d5

Please sign in to comment.