Skip to content

Commit

Permalink
Merge branch 'main' of github.com:mlr-org/bbotk
Browse files Browse the repository at this point in the history
  • Loading branch information
be-marc committed Nov 26, 2021
2 parents ed2ea64 + 24aa338 commit 3f40520
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 2 additions & 3 deletions R/Optimizer.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,14 @@ Optimizer = R6Class("Optimizer",
#' @param param_classes (`character()`).
#' @param properties (`character()`).
#' @param packages (`character()`).
initialize = function(param_set, param_classes, properties,
packages = character()) {
initialize = function(param_set, param_classes, properties, packages = character()) {
private$.param_set = assert_param_set(param_set)
self$param_classes = assert_subset(param_classes,
c("ParamLgl", "ParamInt", "ParamDbl", "ParamFct", "ParamUty"))
# has to have at least multi-crit or single-crit property
self$properties = assert_subset(properties,
bbotk_reflections$optimizer_properties, empty.ok = FALSE)
self$packages = assert_set(packages)
self$packages = union("bbotk", assert_character(packages, any.missing = FALSE, min.chars = 1L))

check_packages_installed(self$packages, msg = sprintf("Package '%%s' required but not installed for Optimizer '%s'", format(self)))
},
Expand Down
5 changes: 5 additions & 0 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
}
lg$set_filters(f)

register_namespace_callback("bbotk", "mlr3", function(pkgname, pkgpath) {
x = utils::getFromNamespace("mlr_reflections", ns = "mlr3")
x$loggers = c(x$loggers, list("bbotk" = lg))
})

if (Sys.getenv("IN_PKGDOWN") == "true") {
lg$set_threshold("warn")
}
Expand Down

0 comments on commit 3f40520

Please sign in to comment.