Skip to content

Commit c41db6c

Browse files
committed
Merge branch 'master' of https://github.com/stan-dev/posterior
2 parents 12a2332 + 495c60b commit c41db6c

File tree

6 files changed

+26
-12
lines changed

6 files changed

+26
-12
lines changed

.github/workflows/rcmdcheck.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,19 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
config:
23-
- {os: macOS-latest, r: 'devel'}
24-
- {os: macOS-latest, r: 'release'}
25-
- {os: windows-latest, r: 'release'}
26-
- {os: windows-latest, r: '3.6'}
27-
- {os: ubuntu-18.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest", http-user-agent: "R/4.0.0 (ubuntu-18.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
28-
- {os: ubuntu-18.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
29-
- {os: ubuntu-18.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
23+
- {os: macOS-latest, r: 'devel', suggested_check: TRUE}
24+
- {os: macOS-latest, r: 'release', suggested_check: TRUE}
25+
- {os: windows-latest, r: 'release', suggested_check: TRUE}
26+
- {os: windows-latest, r: '3.6', suggested_check: FALSE}
27+
- {os: ubuntu-18.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest", http-user-agent: "R/4.0.0 (ubuntu-18.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" , suggested_check: TRUE}
28+
- {os: ubuntu-18.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest", suggested_check: TRUE}
29+
- {os: ubuntu-18.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest", suggested_check: FALSE}
3030

3131
env:
3232
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
3333
RSPM: ${{ matrix.config.rspm }}
3434
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
35+
_R_CHECK_FORCE_SUGGESTS_: ${{ matrix.config.suggested_check }}
3536

3637
steps:
3738
- uses: n1hility/cancel-previous-runs@v2

R/rstar.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
#'
7171
#' @examples
7272
#' \donttest{
73-
#' if (require("caret", quietly = TRUE)) {
73+
#' if (require("caret", quietly = TRUE) && require("randomForest", quietly = TRUE)) {
7474
#' x <- example_draws("eight_schools")
7575
#' print(rstar(x))
7676
#' print(rstar(x, split = FALSE))

man/rstar.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-print.R

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,20 @@ test_that("print.draws_list runs without errors", {
4343
})
4444

4545
test_that("print.draws_rvars runs without errors", {
46+
skip_on_os("windows")
4647
x <- as_draws_rvars(example_draws())
47-
expect_output(print(x),
48-
"A draws_rvars: 100 iterations, 4 chains, and 3 variables"
48+
expect_output(
49+
print(x),
50+
"A draws_rvars: 100 iterations, 4 chains, and 3 variables",
51+
fixed = TRUE
4952
)
5053

5154
x <- weight_draws(x, rep(1, ndraws(x)))
52-
expect_output(print(x), "hidden reserved variables \\{'\\.log_weight'\\}")
55+
expect_output(
56+
print(x),
57+
"hidden reserved variables {'.log_weight'}",
58+
fixed = TRUE
59+
)
5360
})
5461

5562
test_that("print.draws_array handles reserved variables correctly", {
@@ -97,6 +104,7 @@ test_that("print.draws_list handles reserved variables correctly", {
97104
})
98105

99106
test_that("print.draws_rvars handles reserved variables correctly", {
107+
skip_on_os("windows")
100108
x <- as_draws_rvars(example_draws())
101109
variables(x)[1] <- ".log_weight" # reserved name
102110
expect_output(print(x, max_variables = 1), "tau")

tests/testthat/test-rstar.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11

22
test_that("rstar returns reasonable values", {
33
skip_if_not_installed("caret")
4+
skip_if_not_installed("randomForest")
45
x <- example_draws()
56
val <- rstar(x)
67
expect_true(val > 0.8 & val < 10)
78
})
89

910
test_that("rstar works with 1d example", {
1011
skip_if_not_installed("caret")
12+
skip_if_not_installed("randomForest")
1113
x <- example_draws()
1214
x <- as_draws_df(x)
1315
# remove all bar one variable
@@ -18,6 +20,7 @@ test_that("rstar works with 1d example", {
1820

1921
test_that("rstar works with draws_df example", {
2022
skip_if_not_installed("caret")
23+
skip_if_not_installed("randomForest")
2124
x <- example_draws()
2225
x <- as_draws_df(x)
2326
val <- rstar(x)

tests/testthat/test-rvar-print.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
test_that("basic print.rvar works", {
2+
skip_on_os("windows")
23
x <- rvar(array(1:12, dim = c(2,2,3)))
34
x_with_chains <- rvar(array(1:12, dim = c(2,2,3)), nchains = 2)
45

@@ -26,6 +27,7 @@ NULL",
2627
})
2728

2829
test_that("basic str.rvar works", {
30+
skip_on_os("windows")
2931
x <- rvar(array(1:24, dim = c(2,3,4)))
3032
x_with_chains <- rvar(array(1:24, dim = c(2,3,4)), nchains = 2)
3133

0 commit comments

Comments
 (0)