Skip to content

Commit

Permalink
replace checkmate::expect_* with checkmate::assert_* outside tests
Browse files Browse the repository at this point in the history
  • Loading branch information
n-kall committed Dec 14, 2023
1 parent adf3813 commit 27153ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions R/pareto_smooth.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions R/weight_draws.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
}
Expand Down

0 comments on commit 27153ff

Please sign in to comment.