Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/testthat/test-butcher-recipes.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ terms_empty_env <- function(axed, step_number) {
}

test_that("recipe + step_nnmf_sparse + axe_env() works", {
skip_if(utils::packageVersion("recipes") < "0.1.17.9001")
skip_if_not_installed("recipes", "0.1.17.9001")
rec <- recipe(HHV ~ ., data = biomass_tr) %>%
step_nnmf_sparse(all_numeric_predictors(), num_comp = 2, seed = 473)
x <- axe_env(rec)
terms_empty_env(x, 1)
})

test_that("recipe + step_nnmf_sparse + bake() works", {
skip_if(utils::packageVersion("recipes") < "0.1.17.9001")
skip_if_not_installed("recipes", "0.1.17.9001")
rec <- recipe(HHV ~ ., data = biomass_tr) %>%
step_nnmf_sparse(all_numeric_predictors(), num_comp = 2, seed = 473) %>%
prep()
Expand Down
10 changes: 5 additions & 5 deletions tests/testthat/test-parsnip-extension-messaging.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
test_that('messaging with unknown implementation (bag tree, tidymodels/parsnip#793)', {
skip_if(utils::packageVersion("parsnip") < "1.0.2")
skip_if_not_installed("parsnip", "1.0.2")

library(parsnip)

Expand Down Expand Up @@ -68,7 +68,7 @@ test_that('messaging with unknown implementation (bag tree, tidymodels/parsnip#7
})

test_that('messaging with unknown implementation (decision tree, tidymodels/parsnip#793)', {
skip_if(utils::packageVersion("parsnip") < "1.0.2")
skip_if_not_installed("parsnip", "1.0.2")

library(parsnip)

Expand Down Expand Up @@ -136,7 +136,7 @@ test_that('missing implementation checks prompt conservatively with old objects
# extension packages, as well as model specs generated before parsnip 1.0.2,
# will not have this slot. ensure that these messages/errors aren't
# erroneously introduced when that's the case
skip_if(utils::packageVersion("parsnip") < "1.0.2")
skip_if_not_installed("parsnip", "1.0.2")

library(parsnip)

Expand All @@ -159,7 +159,7 @@ test_that('missing implementation checks prompt conservatively with old objects

test_that('missing implementation checks prompt conservatively with old objects (decision_tree)', {
# see comment in above chunk
skip_if(utils::packageVersion("parsnip") < "1.0.2")
skip_if_not_installed("parsnip", "1.0.2")

library(parsnip)

Expand Down Expand Up @@ -190,7 +190,7 @@ test_that('missing implementation checks prompt conservatively with old objects

test_that('missing implementation checks prompt conservatively with external objects (arima_boost)', {
# see comment in above chunk
skip_if(utils::packageVersion("parsnip") < "1.0.2")
skip_if_not_installed("parsnip", "1.0.2")

library(modeltime)

Expand Down
12 changes: 6 additions & 6 deletions tests/testthat/test-recipes-nnmf_sparse.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ library(recipes)
suppressPackageStartupMessages(library(Matrix)) # Waiting for fix in RcppML

test_that('Correct values', {
skip_if(utils::packageVersion("recipes") < "0.1.17.9001")
skip_if_not_installed("recipes", "0.1.17.9001")

rec <- recipe(Species ~ ., data = iris) %>%
step_nnmf_sparse(all_predictors(), seed = 2432)
Expand All @@ -30,7 +30,7 @@ test_that('Correct values', {
})

test_that('No NNF', {
skip_if(utils::packageVersion("recipes") < "0.1.17.9001")
skip_if_not_installed("recipes", "0.1.17.9001")

rec <- recipe(Species ~ ., data = iris) %>%
step_nnmf_sparse(all_predictors(), seed = 2432, num_comp = 0) %>%
Expand All @@ -46,7 +46,7 @@ test_that('No NNF', {
})

test_that('tunable', {
skip_if(utils::packageVersion("recipes") < "0.1.17.9001")
skip_if_not_installed("recipes", "0.1.17.9001")
rec <-
recipe(~., data = iris) %>%
step_nnmf_sparse(all_predictors())
Expand All @@ -62,7 +62,7 @@ test_that('tunable', {
})

test_that('keep_original_cols works', {
skip_if(utils::packageVersion("recipes") < "0.1.17.9001")
skip_if_not_installed("recipes", "0.1.17.9001")

rec <- recipe(Species ~ ., data = iris) %>%
step_nnmf_sparse(all_predictors(), seed = 2432, keep_original_cols = TRUE)
Expand All @@ -85,7 +85,7 @@ test_that('keep_original_cols works', {
})

test_that('can prep recipes with no keep_original_cols', {
skip_if(utils::packageVersion("recipes") < "0.1.17.9001")
skip_if_not_installed("recipes", "0.1.17.9001")

rec <- recipe(Species ~ ., data = iris) %>%
step_nnmf_sparse(all_predictors(), seed = 2432)
Expand All @@ -105,7 +105,7 @@ test_that('can prep recipes with no keep_original_cols', {
})

test_that('tidy method', {
skip_if(utils::packageVersion("recipes") < "1.0.6.9000")
skip_if_not_installed("recipes", "1.0.6.9000")

set.seed(1)
rec <- recipe(~., data = mtcars) %>%
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-stacks-columns.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ library(dplyr)

test_that("stacks can accommodate outcome levels that are not valid colnames", {
# skip on pre-0.2.4
skip_if(utils::packageVersion("stacks") < "0.2.3.9001")
skip_if_not_installed("stacks", "0.2.3.9001")
skip_if_not_installed("tune", "1.3.0.9006")

data("penguins")
Expand Down
12 changes: 6 additions & 6 deletions tests/testthat/test-stacks-tuning.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ wf_set <-

# tests ------------------------------------------------------------------
test_that("stacking with grid search works", {
skip_if(utils::packageVersion("stacks") < "1.0.0.9000")
skip_if_not_installed("stacks", "1.0.0.9000")

wf_set_grid <-
workflow_map(
Expand Down Expand Up @@ -112,7 +112,7 @@ test_that("stacking with grid search works", {
})

test_that("stacking with Bayesian tuning works", {
skip_if(utils::packageVersion("stacks") < "1.0.0.9000")
skip_if_not_installed("stacks", "1.0.0.9000")

wf_set_bayes <-
workflow_map(
Expand Down Expand Up @@ -158,7 +158,7 @@ test_that("stacking with Bayesian tuning works", {
})

test_that("stacking with finetune works (anova)", {
skip_if(utils::packageVersion("stacks") < "1.0.0.9000")
skip_if_not_installed("stacks", "1.0.0.9000")

wf_set_anova <-
workflow_map(
Expand Down Expand Up @@ -229,8 +229,8 @@ test_that("stacking with finetune works (anova)", {
})

test_that("stacking with finetune works (sim_anneal)", {
skip_if(utils::packageVersion("stacks") < "1.0.0.9000")
skip_if(utils::packageVersion("finetune") < "1.1.0.9001")
skip_if_not_installed("stacks", "1.0.0.9000")
skip_if_not_installed("finetune", "1.1.0.9001")

wf_set_sim_anneal <-
workflow_map(
Expand Down Expand Up @@ -293,7 +293,7 @@ test_that("stacking with finetune works (sim_anneal)", {
})

test_that("stacking with finetune works (win_loss)", {
skip_if(utils::packageVersion("stacks") < "1.0.0.9000")
skip_if_not_installed("stacks", "1.0.0.9000")

wf_set_win_loss <-
workflow_map(
Expand Down
Loading