Skip to content

Commit 2f008d4

Browse files
authored
Merge pull request #625 from stan-dev/use-rstantools
Use rstantools - Fix Build/Export Errors
2 parents 855d59a + 0065f13 commit 2f008d4

147 files changed

Lines changed: 8953 additions & 605 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/R-CMD-check.yaml

Lines changed: 12 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -12,63 +12,34 @@ name: R-CMD-check
1212

1313
jobs:
1414
R-CMD-check:
15-
runs-on: ${{ matrix.config.os }}
15+
runs-on: ${{ matrix.os }}
1616

17-
name: ${{ matrix.config.rstan }} RStan - ${{ matrix.config.os }} (${{ matrix.config.r }})
17+
name: R CMD CHECK - ${{ matrix.os }} (${{ matrix.r }})
1818

1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
config:
23-
- {os: macOS-latest, r: 'devel', rstan: 'CRAN'}
24-
- {os: macOS-latest, r: 'release', rstan: 'CRAN'}
25-
- {os: windows-latest, r: 'devel', rstan: 'CRAN'}
26-
- {os: windows-latest, r: 'release', rstan: 'CRAN'}
27-
- {os: ubuntu-latest, r: 'devel', rstan: 'CRAN'}
28-
- {os: ubuntu-latest, r: 'release', rstan: 'CRAN'}
29-
- {os: ubuntu-latest, r: 'oldrel', rstan: 'CRAN'}
30-
31-
- {os: macOS-latest, r: 'release', rstan: 'Preview'}
32-
- {os: windows-latest, r: 'release', rstan: 'Preview'}
22+
os: [macOS-latest, windows-latest, ubuntu-latest, ubuntu-24.04-arm]
23+
r: ['devel', 'release', 'oldrel']
3324
env:
3425
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
35-
RSPM: ${{ matrix.config.rspm }}
3626
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
27+
TESTTHAT_CPUS: 4
3728

3829
steps:
39-
- uses: n1hility/cancel-previous-runs@v2
30+
- uses: n1hility/cancel-previous-runs@master
4031
with:
4132
token: ${{ secrets.GITHUB_TOKEN }}
42-
workflow: R-CMD-check.yaml
4333
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"
4434

45-
- uses: actions/checkout@v3
35+
- uses: actions/checkout@main
4636

47-
- uses: r-lib/actions/setup-r@v2
37+
- uses: r-lib/actions/setup-r@v2-branch
4838
with:
49-
r-version: ${{ matrix.config.r }}
39+
r-version: ${{ matrix.r }}
5040

51-
- uses: r-lib/actions/setup-pandoc@v2
52-
- uses: r-lib/actions/setup-r-dependencies@v2
41+
- uses: r-lib/actions/setup-pandoc@v2-branch
42+
- uses: r-lib/actions/setup-r-dependencies@v2-branch
5343
with:
54-
cache-version: 2
5544
extra-packages: any::rcmdcheck any::betareg any::HSAUR3 any::biglm any::gamm4 any::V8
56-
57-
- name: Install RStan Preview if Needed
58-
run: |
59-
if ("${{ matrix.config.rstan }}" == "Preview") {
60-
install.packages("rstan", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
61-
}
62-
shell: Rscript {0}
63-
64-
- uses: r-lib/actions/check-r-package@v2
65-
with:
66-
args: 'c("--no-manual", "--as-cran", "--ignore-vignettes")'
67-
build_args: '"--no-build-vignettes"'
68-
69-
- name: Upload check results
70-
if: failure()
71-
uses: actions/upload-artifact@main
72-
with:
73-
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
74-
path: check
45+
- uses: r-lib/actions/check-r-package@v2-branch

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@ src/stan_files/*.hpp
88
src/rstanarm.so
99
src/rstanarm.dll
1010
src/init.o
11-
man/*.Rd
1211
!man/rstanarm-internal.Rd
1312
vignettes/*.R
1413
!vignettes/*.Rmd
1514
vignettes/*.html
1615
vignettes/*_files
1716
.DS_Store
1817
revdep/*
18+
*.o
19+
*.cc
20+
*.h
21+
src/Makevars
22+
R/stanmodels.R

R/misc.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,10 @@ get_x.default <- function(object, ...) {
596596
object[["x"]] %ORifNULL% model.matrix(object)
597597
}
598598
#' @export
599+
get_x.betareg <- function(object, ...) {
600+
model.matrix(object$terms[["mean"]], model.frame(object), contrasts = object$contrasts[["contrasts"]])
601+
}
602+
#' @export
599603
get_x.gamm4 <- function(object, ...) {
600604
as.matrix(object[["x"]])
601605
}

R/stanmodels.R

Lines changed: 0 additions & 37 deletions
This file was deleted.

R/zzz.R

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,20 @@
11
# Part of the rstanarm package for estimating model parameters
22
# Copyright (C) 2015, 2016, 2017 Trustees of Columbia University
3-
#
3+
#
44
# This program is free software; you can redistribute it and/or
55
# modify it under the terms of the GNU General Public License
66
# as published by the Free Software Foundation; either version 3
77
# of the License, or (at your option) any later version.
8-
#
8+
#
99
# This program is distributed in the hope that it will be useful,
1010
# but WITHOUT ANY WARRANTY; without even the implied warranty of
1111
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212
# GNU General Public License for more details.
13-
#
13+
#
1414
# You should have received a copy of the GNU General Public License
1515
# along with this program; if not, write to the Free Software
1616
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1717

18-
.onLoad <- function(libname, pkgname) {
19-
modules <- paste0("stan_fit4", names(stanmodels), "_mod")
20-
for (m in modules) loadModule(m, what = TRUE)
21-
}
22-
2318
.onAttach <- function(...) {
2419
ver <- utils::packageVersion("rstanarm")
2520
packageStartupMessage("This is rstanarm version ", ver)

cleanup

Lines changed: 0 additions & 5 deletions
This file was deleted.

cleanup.win

Lines changed: 0 additions & 7 deletions
This file was deleted.

configure

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#! /bin/sh
2+
"${R_HOME}/bin/Rscript" -e "rstantools::rstan_config()"

configure.ac

Lines changed: 0 additions & 62 deletions
This file was deleted.

configure.win

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#! /bin/sh
2+
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "rstantools::rstan_config()"

0 commit comments

Comments
 (0)