diff --git a/R/Domain_methods.R b/R/Domain_methods.R index f73a6f37..83d3dab6 100644 --- a/R/Domain_methods.R +++ b/R/Domain_methods.R @@ -46,7 +46,7 @@ domain_test = function(param, values) isTRUE(domain_check(param, values)) #' This should be the number of discrete possible levels for discrete type [`Domain`]s such as [`p_int()`] or [`p_fct()`], and #' `Inf` for continuous or untyped parameters. #' -#' @param x (`Domain`). +#' @param param (`Domain`). #' @return `numeric`. #' @keywords internal #' @export diff --git a/R/ParamSet.R b/R/ParamSet.R index 576d2698..529338dd 100644 --- a/R/ParamSet.R +++ b/R/ParamSet.R @@ -240,6 +240,7 @@ ParamSet = R6Class("ParamSet", if (is.data.frame(x)) x = as.list(x) assert_list(x, names = "unique") trafos = private$.trafos[names(x), .(id, trafo), nomatch = 0] + value = NULL # static checks trafos[, value := x[id]] if (nrow(trafos)) { transformed = pmap(trafos, function(id, trafo, value) trafo(value)) @@ -547,6 +548,7 @@ ParamSet = R6Class("ParamSet", x = t(x) params = private$.params[rownames(x), on = "id"] params$result = list() + result = NULL # static checks params[, result := list(as.list(as.data.frame(t(matrix(domain_qunif(recover_domain(.SD, .BY), x[id, ]), nrow = .N))))), by = c("cls", "grouping")] as.data.table(set_names(params$result, params$id)) @@ -750,7 +752,7 @@ ParamSet = R6Class("ParamSet", # convert all integer params really to storage type int, move doubles to within bounds etc. # solves issue #293, #317 nontt = discard(xs, inherits, "TuneToken") - + values = special_vals = NULL # static checks sanitized = set(private$.params[names(nontt), on = "id"], , "values", list(nontt))[ !pmap_lgl(list(special_vals, values), has_element), .(id, values = domain_sanitize(recover_domain(.SD, .BY), values)), by = c("cls", "grouping")] diff --git a/R/zzz.R b/R/zzz.R index 889ab788..3b1dc802 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -11,7 +11,7 @@ # data.table-variables to announce: # .init_given, .trafo -utils::globalVariables(c("J", "id", "original_id", "owner_ps_index", ".tags", "tag", ".trafo", ".", "cargo", "default", "cls", "cond", "on")) +utils::globalVariables(c("J", "id", "original_id", "owner_ps_index", ".tags", "tag", ".trafo", "trafo", ".", "cargo", "default", "cls", "cond", "on")) .onLoad = function(libname, pkgname) { # nolint # nocov start diff --git a/man/domain_nlevels.Rd b/man/domain_nlevels.Rd index a74c2cf6..e4d1511e 100644 --- a/man/domain_nlevels.Rd +++ b/man/domain_nlevels.Rd @@ -7,7 +7,7 @@ domain_nlevels(param) } \arguments{ -\item{x}{(\code{Domain}).} +\item{param}{(\code{Domain}).} } \value{ \code{numeric}.