From 27153ff02b116325e2700f972677b41377f345d8 Mon Sep 17 00:00:00 2001 From: n-kall Date: Thu, 14 Dec 2023 14:27:29 +0200 Subject: [PATCH] replace checkmate::expect_* with checkmate::assert_* outside tests --- R/pareto_smooth.R | 4 ++-- R/weight_draws.R | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/pareto_smooth.R b/R/pareto_smooth.R index 52ec6bb..4593ce9 100644 --- a/R/pareto_smooth.R +++ b/R/pareto_smooth.R @@ -259,8 +259,8 @@ pareto_smooth.default <- function(x, are_log_weights = FALSE, ...) { - checkmate::expect_numeric(ndraws_tail, null.ok = TRUE) - checkmate::expect_numeric(r_eff, null.ok = TRUE) + checkmate::assert_numeric(ndraws_tail, null.ok = TRUE) + checkmate::assert_numeric(r_eff, null.ok = TRUE) extra_diags <- as_one_logical(extra_diags) return_k <- as_one_logical(return_k) verbose <- as_one_logical(verbose) diff --git a/R/weight_draws.R b/R/weight_draws.R index 3449482..fa8bfd8 100644 --- a/R/weight_draws.R +++ b/R/weight_draws.R @@ -179,8 +179,8 @@ weights.draws <- function(object, log = FALSE, normalize = TRUE, ...) { # validate weights and return log weights validate_weights <- function(weights, draws, log = FALSE) { - checkmate::expect_numeric(weights) - checkmate::expect_flag(log) + checkmate::assert_numeric(weights) + checkmate::assert_flag(log) if (length(weights) != ndraws(draws)) { stop_no_call("Number of weights must match the number of draws.") }