From 695dba60aae1b0f56586262eb39ef8f778816b5f Mon Sep 17 00:00:00 2001 From: Ven Popov Date: Thu, 21 Mar 2024 14:13:42 +0100 Subject: [PATCH] fix check for adapt_engaged --- R/args.R | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/R/args.R b/R/args.R index ca1ebb41..01378ddf 100644 --- a/R/args.R +++ b/R/args.R @@ -286,9 +286,6 @@ SampleArgs <- R6::R6Class( if (is.logical(self$save_metric)) { self$save_metric <- as.integer(self$save_metric) } - if (!self$adapt_engaged & !is.null(self$save_metric)) { - self$save_metric <- 0 - } invisible(self) }, validate = function(num_procs) { @@ -817,6 +814,10 @@ validate_sample_args <- function(self, num_procs) { len = 1, null.ok = TRUE) + if (is.null(self$adapt_engaged) || (!self$adapt_engaged && !is.null(self$save_metric))) { + self$save_metric <- 0 + } + invisible(TRUE) }