Skip to content

Commit fc567a7

Browse files
authored
partial fix: bbotk logger depending on package version
1 parent 5c00e79 commit fc567a7

File tree

12 files changed

+130
-403
lines changed

12 files changed

+130
-403
lines changed

R/AcqOptimizer.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ AcqOptimizer = R6Class("AcqOptimizer",
150150
optimize = function() {
151151
is_multi_acq_function = self$acq_function$codomain$length > 1L
152152

153-
lg = lgr::get_logger("bbotk")
153+
lg = lgr::get_logger("mlr3/bbotk")
154154
old_threshold = lg$threshold
155155
lg$set_threshold(self$param_set$values$logging_level)
156156
on.exit(lg$set_threshold(old_threshold))

R/OptimizerAsyncMbo.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ OptimizerAsyncMbo = R6Class("OptimizerAsyncMbo",
218218

219219
check_packages_installed(self$packages, msg = sprintf("Package '%%s' required but not installed for Optimizer '%s'", format(self)))
220220

221-
lg = lgr::get_logger("bbotk")
221+
lg = lgr::get_logger("mlr3/bbotk")
222222
pv = self$param_set$values
223223

224224
# initial design
@@ -331,7 +331,7 @@ OptimizerAsyncMbo = R6Class("OptimizerAsyncMbo",
331331
.result_assigner = NULL,
332332

333333
.optimize = function(inst) {
334-
lg = lgr::get_logger("bbotk")
334+
lg = lgr::get_logger("mlr3/bbotk")
335335
lg$debug("Optimizer '%s' evaluates the initial design", self$id)
336336
get_private(inst)$.eval_queue()
337337

R/OptimizerMbo.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ OptimizerMbo = R6Class("OptimizerMbo",
335335
{
336336
self$surrogate$update()
337337
}, surrogate_update_error = function(error_condition) {
338-
lg = lgr::get_logger("bbotk")
338+
lg = lgr::get_logger("mlr3/bbotk")
339339
lg$warn("Could not update the surrogate a final time after the optimization process has terminated.")
340340
}
341341
)

R/zzz.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ register_mlr3tuning = function() {
3030
register_namespace_callback(pkgname, "bbotk", register_bbotk)
3131
register_namespace_callback(pkgname, "mlr3tuning", register_mlr3tuning)
3232

33-
assign("lg", lgr::get_logger("bbotk"), envir = parent.env(environment()))
33+
#https://github.com/mlr-org/bbotk/blob/ae6cac60f71b3c44ce1bb29669f5d06cddeb95d4/R/zzz.R#L20
34+
lg = lgr::get_logger("mlr3/bbotk")
35+
assign("lg", lg, envir = parent.env(environment()))
3436

3537
if (Sys.getenv("IN_PKGDOWN") == "true") {
3638
lg$set_threshold("warn")

attic/so_config/analyze.R

Lines changed: 0 additions & 57 deletions
This file was deleted.

attic/so_config/min_max.R

Lines changed: 0 additions & 39 deletions
This file was deleted.

attic/so_config/run.R

Lines changed: 0 additions & 161 deletions
This file was deleted.

attic/so_config/submit.sh

Lines changed: 0 additions & 20 deletions
This file was deleted.

tests/testthat/setup.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ old_opts = options(
88
old_opts = lapply(old_opts, function(x) if (is.null(x)) FALSE else x)
99

1010
lg_mlr3 = lgr::get_logger("mlr3")
11-
lg_bbotk = lgr::get_logger("bbotk")
11+
lg_bbotk = lgr::get_logger("mlr3/bbotk")
1212
lg_rush = lgr::get_logger("rush")
1313

1414
old_threshold_mlr3 = lg_mlr3$threshold

0 commit comments

Comments
 (0)