From 33cc542ca0beed6432d7a60515c9e0550382fdae Mon Sep 17 00:00:00 2001 From: simonpcouch Date: Thu, 12 Sep 2024 16:41:14 -0400 Subject: [PATCH] `check_tailor()` in helper functions --- R/utils.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/R/utils.R b/R/utils.R index ea6224b..4207cb5 100644 --- a/R/utils.R +++ b/R/utils.R @@ -62,6 +62,8 @@ is_tailor <- function(x) { #' @keywords internal #' @rdname tailor-internals tailor_fully_trained <- function(x) { + check_tailor(x) + if (length(x$adjustments) == 0L) { return(FALSE) } @@ -77,6 +79,8 @@ tailor_adjustment_trained <- function(x) { #' @keywords internal #' @rdname tailor-internals tailor_requires_fit <- function(x) { + check_tailor(x) + any(purrr::map_lgl(x$adjustments, tailor_adjustment_requires_fit)) }