Skip to content

Commit

Permalink
modify workflows; use more robust checking for cmdstan installs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Clark committed Apr 25, 2024
1 parent 974a21a commit 790e89e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check-rstan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:
branches: [main, master]

name: R-CMD-check-cmdstan
name: R-CMD-check

jobs:
R-CMD-check:
Expand Down
10 changes: 10 additions & 0 deletions R/mvgam.R
Original file line number Diff line number Diff line change
Expand Up @@ -1355,6 +1355,16 @@ mvgam = function(formula,
'laplace'))
backend <- match.arg(backend, c('rstan',
'cmdstanr'))

cmdstan_avail <- insight::check_if_installed('cmdstanr',
stop = FALSE,
quietly = TRUE)

if(isTRUE(cmdstan_avail)){
if(is.null(cmdstanr::cmdstan_version(error_on_NA = FALSE))){
backend <- 'rstan'
}
}
fit_engine <- 'stan'
use_cmdstan <- ifelse(backend == 'cmdstanr', TRUE, FALSE)

Expand Down
Binary file modified src/mvgam.dll
Binary file not shown.
Binary file modified tests/testthat/Rplots.pdf
Binary file not shown.

0 comments on commit 790e89e

Please sign in to comment.