Skip to content

Commit

Permalink
Move 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 954a19c commit ef0c09d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions R/check.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@
#' 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 All @@ -52,6 +48,9 @@ sanity <- function(object, big_sd_log10 = 2, gradient_thresh = 0.001, silent = F
return(FALSE)
}
assert_that(inherits(object, "sdmTMB"))
if ( isFALSE(object$call$do_fit)) {
cli_abort("`do_fit = FALSE` so this model hasn't been fit yet")
}

hessian_ok <- eigen_values_ok <- gradients_ok <- se_magnitude_ok <- FALSE
nlminb_ok <- FALSE
Expand Down

0 comments on commit ef0c09d

Please sign in to comment.