Skip to content

Commit

Permalink
unify code styling
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch committed Dec 11, 2024
1 parent ea3d119 commit fd0ddbf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
16 changes: 10 additions & 6 deletions R/validation-rules.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ check_classification_order <- function(x, call) {
# does probability steps come after steps that change the hard classes?
if (length(prob_ind) > 0) {
if (any(class_ind < prob_ind)) {
cli_abort("adjustments that change the hard class predictions \\
must come after adjustments that update the class \\
probability estimates.", call = call)
cli_abort(
"Adjustments that change the hard class predictions must come after
adjustments that update the class probability estimates.",
call = call
)
}
}

Expand All @@ -53,9 +55,11 @@ check_classification_order <- function(x, call) {
# do any steps come before Eq zones
if (length(eq_ind) > 0) {
if (any(eq_ind < class_ind) | any(eq_ind < prob_ind)) {
cli_abort("Equivocal zone addition should come after adjustments \\
that update the class probability estimates or hard \\
class predictions.", call = call)
cli_abort(
"Equivocal zone addition should come after adjustments that update the
class probability estimates or hard class predictions.",
call = call
)
}
}

Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/_snaps/validation-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
adjust_probability_calibration()
Condition
Error in `adjust_probability_calibration()`:
! adjustments that change the hard class predictions must come after adjustments that update the class probability estimates.
! Adjustments that change the hard class predictions must come after adjustments that update the class probability estimates.

---

Expand All @@ -24,7 +24,7 @@
adjust_probability_calibration()
Condition
Error in `adjust_probability_calibration()`:
! adjustments that change the hard class predictions must come after adjustments that update the class probability estimates.
! Adjustments that change the hard class predictions must come after adjustments that update the class probability estimates.

---

Expand Down

0 comments on commit fd0ddbf

Please sign in to comment.