Skip to content

Commit 81f1b7a

Browse files
committed
reformatting for quoting arguments and no others() arg
1 parent c16e788 commit 81f1b7a

27 files changed

+571
-443
lines changed

tests/testthat/test_boost_tree.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,4 @@ test_that('bad input', {
136136
expect_error(translate(boost_tree(formula = y ~ x)))
137137
})
138138

139-
###################################################################
139+
# ------------------------------------------------------------------------------

tests/testthat/test_boost_tree_C50.R

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
library(testthat)
2-
context("boosted tree execution with C5.0")
32
library(parsnip)
43
library(tibble)
54

6-
###################################################################
5+
# ------------------------------------------------------------------------------
6+
7+
context("boosted tree execution with C5.0")
78

89
data("lending_club")
910
lending_club <- head(lending_club, 200)
1011
num_pred <- c("funded_amnt", "annual_inc", "num_il_tl")
1112
lc_basic <- boost_tree(mode = "classification")
13+
1214
ctrl <- fit_control(verbosity = 1, catch = FALSE)
1315
caught_ctrl <- fit_control(verbosity = 1, catch = TRUE)
1416
quiet_ctrl <- fit_control(verbosity = 0, catch = TRUE)
1517

18+
# ------------------------------------------------------------------------------
19+
1620
test_that('C5.0 execution', {
1721

1822
skip_if_not_installed("C50")

tests/testthat/test_boost_tree_spark.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
library(testthat)
2-
context("boosted tree execution with spark")
32
library(parsnip)
43
library(dplyr)
54

65
# ------------------------------------------------------------------------------
76

7+
context("boosted tree execution with spark")
8+
89
ctrl <- fit_control(verbosity = 1, catch = FALSE)
910
caught_ctrl <- fit_control(verbosity = 1, catch = TRUE)
1011
quiet_ctrl <- fit_control(verbosity = 0, catch = TRUE)

tests/testthat/test_boost_tree_xgboost.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
library(testthat)
2-
context("boosted tree execution with xgboost")
32
library(parsnip)
43

4+
# ------------------------------------------------------------------------------
55

6-
###################################################################
6+
context("boosted tree execution with xgboost")
77

88
num_pred <- names(iris)[1:4]
99

@@ -13,6 +13,8 @@ ctrl <- fit_control(verbosity = 1, catch = FALSE)
1313
caught_ctrl <- fit_control(verbosity = 1, catch = TRUE)
1414
quiet_ctrl <- fit_control(verbosity = 0, catch = TRUE)
1515

16+
# ------------------------------------------------------------------------------
17+
1618
test_that('xgboost execution, classification', {
1719

1820
skip_if_not_installed("xgboost")
@@ -83,7 +85,7 @@ test_that('xgboost classification prediction', {
8385
})
8486

8587

86-
###################################################################
88+
# ------------------------------------------------------------------------------
8789

8890
num_pred <- names(mtcars)[3:6]
8991

tests/testthat/test_convert_data.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Puromycin_miss <- Puromycin
1616
Puromycin_miss$state[20] <- NA
1717
Puromycin_miss$conc[1] <- NA
1818

19-
###################################################################
19+
# ------------------------------------------------------------------------------
2020

2121
context("Testing formula -> xy conversion")
2222

@@ -308,7 +308,7 @@ test_that("numeric x and multivariate y, matrix composition", {
308308
expect_equal(as.matrix(mtcars[1:6, -(1:2)]), new_obs$x)
309309
})
310310

311-
###################################################################
311+
# ------------------------------------------------------------------------------
312312

313313
context("Testing xy -> formula conversion")
314314

tests/testthat/test_descriptors.R

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
library(testthat)
2-
context("descriptor variables")
32
library(parsnip)
43

4+
# ------------------------------------------------------------------------------
5+
6+
context("descriptor variables")
7+
8+
# ------------------------------------------------------------------------------
9+
510
template <- function(col, pred, ob, lev, fact, dat, x, y) {
611
lst <- list(.n_cols = col, .n_preds = pred, .n_obs = ob,
712
.n_levs = lev, .n_facts = fact, .dat = dat,
@@ -40,34 +45,34 @@ test_that("requires_descrs", {
4045
}
4146

4247
# core args
43-
expect_false(requires_descrs(rand_forest()))
44-
expect_false(requires_descrs(rand_forest(mtry = 3)))
45-
expect_false(requires_descrs(rand_forest(mtry = varying())))
46-
expect_true(requires_descrs(rand_forest(mtry = .n_cols())))
47-
expect_false(requires_descrs(rand_forest(mtry = expr(3))))
48-
expect_false(requires_descrs(rand_forest(mtry = quote(3))))
49-
expect_true(requires_descrs(rand_forest(mtry = fn())))
50-
expect_true(requires_descrs(rand_forest(mtry = fn2())))
48+
expect_false(parsnip:::requires_descrs(rand_forest()))
49+
expect_false(parsnip:::requires_descrs(rand_forest(mtry = 3)))
50+
expect_false(parsnip:::requires_descrs(rand_forest(mtry = varying())))
51+
expect_true(parsnip:::requires_descrs(rand_forest(mtry = .n_cols())))
52+
expect_false(parsnip:::requires_descrs(rand_forest(mtry = expr(3))))
53+
expect_false(parsnip:::requires_descrs(rand_forest(mtry = quote(3))))
54+
expect_true(parsnip:::requires_descrs(rand_forest(mtry = fn())))
55+
expect_true(parsnip:::requires_descrs(rand_forest(mtry = fn2())))
5156

5257
# descriptors in `others`
53-
expect_false(requires_descrs(rand_forest(arrrg = 3)))
54-
expect_false(requires_descrs(rand_forest(arrrg = varying())))
55-
expect_true(requires_descrs(rand_forest(arrrg = .n_obs())))
56-
expect_false(requires_descrs(rand_forest(arrrg = expr(3))))
57-
expect_true(requires_descrs(rand_forest(arrrg = fn())))
58-
expect_true(requires_descrs(rand_forest(arrrg = fn2())))
58+
expect_false(parsnip:::requires_descrs(rand_forest(arrrg = 3)))
59+
expect_false(parsnip:::requires_descrs(rand_forest(arrrg = varying())))
60+
expect_true(parsnip:::requires_descrs(rand_forest(arrrg = .n_obs())))
61+
expect_false(parsnip:::requires_descrs(rand_forest(arrrg = expr(3))))
62+
expect_true(parsnip:::requires_descrs(rand_forest(arrrg = fn())))
63+
expect_true(parsnip:::requires_descrs(rand_forest(arrrg = fn2())))
5964

6065
# mixed
6166
expect_true(
62-
requires_descrs(
67+
parsnip:::requires_descrs(
6368
rand_forest(
6469
mtry = 3,
6570
arrrg = fn2())
6671
)
6772
)
6873

6974
expect_true(
70-
requires_descrs(
75+
parsnip:::requires_descrs(
7176
rand_forest(
7277
mtry = .n_cols(),
7378
arrrg = 3)

0 commit comments

Comments
 (0)