Skip to content

Commit

Permalink
Add do_fit = FALSE check in sanity
Browse files Browse the repository at this point in the history
  • Loading branch information
seananderson committed Mar 26, 2024
1 parent bac6bdf commit bbadbb7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions R/check.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit bbadbb7

Please sign in to comment.