Skip to content

Commit 0e83faf

Browse files
authored
Merge pull request #277 from tidymodels/no-stan-output
prevent long output by stan models
2 parents 9333a0d + 0d1005c commit 0e83faf

File tree

9 files changed

+19
-7
lines changed

9 files changed

+19
-7
lines changed

R/linear_reg.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@
6767
#'
6868
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::linear_reg(), "stan")}
6969
#'
70+
#' (note that the `refresh` default prevents logging of the estimation process. Change this value in `set_engine()` will show the logs)
71+
#'
7072
#' \pkg{spark}
7173
#'
7274
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::linear_reg(), "spark")}

R/linear_reg_data.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ set_fit(
179179
interface = "formula",
180180
protect = c("formula", "data", "weights"),
181181
func = c(pkg = "rstanarm", fun = "stan_glm"),
182-
defaults = list(family = expr(stats::gaussian))
182+
defaults = list(family = expr(stats::gaussian), refresh = 0)
183183
)
184184
)
185185

R/logistic_reg.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@
6565
#'
6666
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::logistic_reg(), "stan")}
6767
#'
68+
#' (note that the `refresh` default prevents logging of the estimation process. Change this value in `set_engine()` will show the logs)
69+
#'
6870
#' \pkg{spark}
6971
#'
7072
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::logistic_reg(), "spark")}

R/logistic_reg_data.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ set_fit(
359359
interface = "formula",
360360
protect = c("formula", "data", "weights"),
361361
func = c(pkg = "rstanarm", fun = "stan_glm"),
362-
defaults = list(family = expr(stats::binomial))
362+
defaults = list(family = expr(stats::binomial), refresh = 0)
363363
)
364364
)
365365

man/linear_reg.Rd

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/logistic_reg.Rd

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/helper-objects.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ ctrl <- control_parsnip(verbosity = 1, catch = FALSE)
99
caught_ctrl <- control_parsnip(verbosity = 1, catch = TRUE)
1010
quiet_ctrl <- control_parsnip(verbosity = 0, catch = TRUE)
1111

12-
run_glmnet <- utils::compareVersion('3.6.0', as.character(getRversion())) < 0
12+
run_glmnet <- utils::compareVersion('3.6.0', as.character(getRversion())) > 0

tests/testthat/test_linear_reg.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ test_that('primary arguments', {
3737
formula = expr(missing_arg()),
3838
data = expr(missing_arg()),
3939
weights = expr(missing_arg()),
40-
family = expr(stats::gaussian)
40+
family = expr(stats::gaussian),
41+
refresh = 0
4142
)
4243
)
4344
expect_equal(basic_spark$method$fit$args,
@@ -142,7 +143,8 @@ test_that('engine arguments', {
142143
weights = expr(missing_arg()),
143144
chains = new_empty_quosure(1),
144145
iter = new_empty_quosure(5),
145-
family = expr(stats::gaussian)
146+
family = expr(stats::gaussian),
147+
refresh = 0
146148
)
147149
)
148150

tests/testthat/test_logistic_reg.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ test_that('primary arguments', {
3838
formula = expr(missing_arg()),
3939
data = expr(missing_arg()),
4040
weights = expr(missing_arg()),
41-
family = expr(stats::binomial)
41+
family = expr(stats::binomial),
42+
refresh = 0
4243
)
4344
)
4445
expect_equal(basic_spark$method$fit$args,
@@ -152,7 +153,8 @@ test_that('engine arguments', {
152153
weights = expr(missing_arg()),
153154
chains = new_empty_quosure(1),
154155
iter = new_empty_quosure(5),
155-
family = expr(stats::binomial)
156+
family = expr(stats::binomial),
157+
refresh = 0
156158
)
157159
)
158160

0 commit comments

Comments
 (0)