Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Hannah Frick <hfrick@users.noreply.github.com>
  • Loading branch information
topepo and hfrick authored Dec 7, 2023
1 parent e1fcbed commit cf6f003
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions R/metric-selection.R
Original file line number Diff line number Diff line change
Expand Up @@ -222,25 +222,25 @@ check_metrics_arg <- function(mtr_set, wflow, call = rlang::caller_env()) {
is_surv_metric_set <- inherits(mtr_set, c("survival_metric_set"))

if (!is_numeric_metric_set && !is_class_prob_metric_set && !is_surv_metric_set) {
cli::cli_abort("The {.val metrics} argument should be the results of
cli::cli_abort("The {.arg metrics} argument should be the results of
{.fn yardstick::metric_set}.", call = call)
}

if (mode == "regression" && !is_numeric_metric_set) {
cli::cli_abort("The parsnip model has {.code mode} value of {.val {mode}},
but the {.code metrics} is a metric set for a
but the {.arg metrics} is a metric set for a
different model mode.", call = call)
}

if (mode == "classification" && !is_class_prob_metric_set) {
cli::cli_abort("The parsnip model has {.code mode} value of {.val {mode}},
but the {.code metrics} is a metric set for a
but the {.arg metrics} is a metric set for a
different model mode.", call = call)
}

if (mode == "censored regression" && !is_surv_metric_set) {
cli::cli_abort("The parsnip model has {.code mode} value of {.val {mode}},
but the {.code metrics} is a metric set for a
but the {.arg metrics} is a metric set for a
different model mode.", call = call)
}

Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-eval-time-args.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ test_that("eval time are checked for classification models", {

})

test_that("eval time inputs are checked for regression models", {
test_that("eval time inputs are checked for censored regression models", {
skip_if_not_installed("censored")

library(parsnip)
Expand Down

0 comments on commit cf6f003

Please sign in to comment.