Skip to content

Commit

Permalink
refactor: only pass extra to assign_result (#473)
Browse files Browse the repository at this point in the history
* refactor: only pass extra to assign_result

* ...

* ...
  • Loading branch information
be-marc authored Nov 26, 2024
1 parent 541c478 commit 3e7cbf8
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 40 deletions.
7 changes: 1 addition & 6 deletions R/TuningInstanceAsyncMulticrit.R
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,9 @@ TuningInstanceAsyncMultiCrit = R6Class("TuningInstanceAsyncMultiCrit",
#'
#' @param ydt (`numeric(1)`)\cr
#' Optimal outcomes, e.g. the Pareto front.
#' @param xydt (`data.table::data.table()`)\cr
#' Point, outcome, and additional information.
#' @param ... (`any`)\cr
#' ignored.
assign_result = function(xdt, ydt, learner_param_vals = NULL, extra = NULL, xydt = NULL, ...) {
# workaround
extra = extra %??% xydt

assign_result = function(xdt, ydt, learner_param_vals = NULL, extra = NULL, ...) {
# assign for callbacks
private$.result_xdt = xdt
private$.result_ydt = ydt
Expand Down
7 changes: 1 addition & 6 deletions R/TuningInstanceAsyncSingleCrit.R
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,9 @@ TuningInstanceAsyncSingleCrit = R6Class("TuningInstanceAsyncSingleCrit",
#'
#' @param y (`numeric(1)`)\cr
#' Optimal outcome.
#' @param xydt (`data.table::data.table()`)\cr
#' Point, outcome, and additional information (Deprecated).
#' @param ... (`any`)\cr
#' ignored.
assign_result = function(xdt, y, learner_param_vals = NULL, extra = NULL, xydt = NULL, ...) {
# workaround
extra = extra %??% xydt

assign_result = function(xdt, y, learner_param_vals = NULL, extra = NULL, ...) {
# assign for callbacks
private$.result_xdt = xdt
private$.result_y = y
Expand Down
7 changes: 1 addition & 6 deletions R/TuningInstanceBatchMulticrit.R
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,9 @@ TuningInstanceBatchMultiCrit = R6Class("TuningInstanceBatchMultiCrit",
#'
#' @param ydt (`data.table::data.table()`)\cr
#' Optimal outcomes, e.g. the Pareto front.
#' @param xydt (`data.table::data.table()`)\cr
#' Point, outcome, and additional information (Deprecated).
#' @param ... (`any`)\cr
#' ignored.
assign_result = function(xdt, ydt, learner_param_vals = NULL, extra = NULL, xydt = NULL, ...) {
# workaround
extra = extra %??% xydt

assign_result = function(xdt, ydt, learner_param_vals = NULL, extra = NULL, ...) {
# assign for callbacks
private$.result_xdt = xdt
private$.result_ydt = ydt
Expand Down
7 changes: 1 addition & 6 deletions R/TuningInstanceBatchSingleCrit.R
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,9 @@ TuningInstanceBatchSingleCrit = R6Class("TuningInstanceBatchSingleCrit",
#'
#' @param y (`numeric(1)`)\cr
#' Optimal outcome.
#' @param xydt (`data.table::data.table()`)\cr
#' Point, outcome, and additional information (Deprecated).
#' @param ... (`any`)\cr
#' ignored.
assign_result = function(xdt, y, learner_param_vals = NULL, extra = NULL, xydt = NULL, ...) {
# workaround
extra = extra %??% xydt

assign_result = function(xdt, y, learner_param_vals = NULL, extra = NULL, ...) {
# assign for callbacks
private$.result_xdt = xdt
private$.result_y = y
Expand Down
4 changes: 0 additions & 4 deletions man/TuningInstanceAsyncMultiCrit.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions man/TuningInstanceAsyncSingleCrit.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions man/TuningInstanceBatchMultiCrit.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions man/TuningInstanceBatchSingleCrit.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3e7cbf8

Please sign in to comment.