R/helper_DataBackend.R

Defines functions assert_spatial_task

Documented in assert_spatial_task

#' Check spatial task
#' @description
#'   Assertion helper for spatial mlr3 tasks.
#' @inheritParams mlr3::assert_task
#' @keywords internal
assert_spatial_task = function(task) {
  if (!checkmate::test_multi_class(task, c("TaskClassifST", "TaskRegrST"))) {
    stopf("Assertion on 'task' failed: Must inherit from class 'TaskClassifST' or 'TaskRegrST'.") # nolint
  }
}
mlr-org/mlr3spatiotempcv documentation built on April 23, 2024, 6:50 a.m.