From bbadbb71a1b68b6fb74333118b877e7081288ff2 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Tue, 26 Mar 2024 12:50:36 -0700 Subject: [PATCH] Add do_fit = FALSE check in sanity --- R/check.R | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/R/check.R b/R/check.R index 0ac773bc1..2b5b74791 100644 --- a/R/check.R +++ b/R/check.R @@ -37,6 +37,11 @@ #' all(unlist(s)) #' all(unlist(s2)) sanity <- function(object, big_sd_log10 = 2, gradient_thresh = 0.001, silent = FALSE) { + + if ( isFALSE(object$call$do_fit)) { + cli_abort("`do_fit = FALSE` so this model hasn't been fit yet") + } + # make it easy to use output from try() if (length(object) <= 1L) { if (is.na(object) || is.null(object)) {