Skip to content

Commit 75553a4

Browse files
committed
tests: irace 4.1.0
1 parent 702b2da commit 75553a4

File tree

6 files changed

+11
-17
lines changed

6 files changed

+11
-17
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# bbotk (development version)
22

3+
4+
35
# bbotk 1.4.1
46

57
* compatibility: irace 4.0.0

R/OptimInstanceBatch.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,16 +178,16 @@ OptimInstanceBatch = R6Class("OptimInstanceBatch",
178178
)
179179
)
180180

181-
objective_function = function(x, inst, maximization_to_minimization) {
181+
objective_function = function(x, inst, direction) {
182182
xs = set_names(as.list(x), inst$search_space$ids())
183183
inst$search_space$assert(xs)
184184
xdt = as.data.table(xs)
185185
res = inst$eval_batch(xdt)
186186
y = as.numeric(res[, inst$objective$codomain$target_ids, with = FALSE])
187-
y * maximization_to_minimization
187+
y * direction
188188
}
189189

190-
objective_error = function(x, inst, maximization_to_minimization) {
190+
objective_error = function(x, inst, direction) {
191191
stop("$objective_function can only be called if search_space only
192192
contains numeric values")
193193
}

R/OptimizerBatchIrace.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@
6666
#'
6767
#' @export
6868
#' @examples
69-
#' # currently there is bug in irace 4.0.0 that sometimes let the example crash
70-
#' \dontrun{
69+
#' # runtime of the example is too long
70+
#' \donttest{
7171
#'
7272
#' library(data.table)
7373
#'
@@ -96,7 +96,7 @@
9696
#' instance = OptimInstanceBatchSingleCrit$new(
9797
#' objective = objective,
9898
#' search_space = search_space,
99-
#' terminator = trm("evals", n_evals = 1000))
99+
#' terminator = trm("evals", n_evals = 96))
100100
#'
101101
#' # create instances of branin function
102102
#' instances = rnorm(10, mean = 0, sd = 0.1)

man/mlr_optimizers_irace.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test_OptimInstanceBatchSingleCrit.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ test_that("$clear() method works", {
215215

216216
optimizer$optimize(inst)
217217
inst$clear()
218-
expect_equal(inst, inst_copy)
218+
suppressWarnings(expect_equal(inst, inst_copy))
219219
})
220220

221221
test_that("context is initialized correctly", {

tests/testthat/test_OptimizerIrace.R

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
test_that("OptimizerBatchIrace minimize works", {
2-
skip_if(TRUE) # Remove this line when irace is fixed
32
skip_if_not_installed("irace")
43

54
search_space = domain = ps(
@@ -40,7 +39,6 @@ test_that("OptimizerBatchIrace minimize works", {
4039
})
4140

4241
test_that("OptimizerBatchIrace maximize works", {
43-
skip_if(TRUE) # Remove this line when irace is fixed
4442
skip_if_not_installed("irace")
4543

4644
search_space = domain = ps(
@@ -81,7 +79,6 @@ test_that("OptimizerBatchIrace maximize works", {
8179
})
8280

8381
test_that("OptimizerBatchIrace assertions works", {
84-
skip_if(TRUE) # Remove this line when irace is fixed
8582
skip_if_not_installed("irace")
8683

8784
search_space = domain = ps(
@@ -109,7 +106,6 @@ test_that("OptimizerBatchIrace assertions works", {
109106
})
110107

111108
test_that("OptimizerBatchIrace works with passed constants set", {
112-
skip_if(TRUE) # Remove this line when irace is fixed
113109
skip_if_not_installed("irace")
114110

115111
search_space = domain = ps(
@@ -135,7 +131,6 @@ test_that("OptimizerBatchIrace works with passed constants set", {
135131
})
136132

137133
test_that("OptimizerBatchIrace works without passed constants set", {
138-
skip_if(TRUE) # Remove this line when irace is fixed
139134
skip_if_not_installed("irace")
140135

141136
search_space = domain = ps(
@@ -162,7 +157,6 @@ test_that("OptimizerBatchIrace works without passed constants set", {
162157

163158

164159
test_that("paradox_to_irace without dependencies", {
165-
skip_if(TRUE) # Remove this line when irace is fixed
166160
skip_if_not_installed("irace")
167161

168162
# only ParamLgl
@@ -204,7 +198,6 @@ test_that("paradox_to_irace without dependencies", {
204198
})
205199

206200
test_that("paradox_to_irace with dependencies", {
207-
skip_if(TRUE) # Remove this line when irace is fixed
208201
skip_if_not_installed("irace")
209202

210203
# one dependency
@@ -257,7 +250,6 @@ test_that("paradox_to_irace with dependencies", {
257250
})
258251

259252
test_that("paradox_to_irace works with parameters with multiple dependencies", {
260-
skip_if(TRUE) # Remove this line when irace is fixed
261253
skip_if_not_installed("irace")
262254

263255
pps = ps(

0 commit comments

Comments
 (0)