Skip to content

Commit 77fe508

Browse files
authored
Merge pull request #118 from stan-dev/prepare-v2.4.0
rstantools v2.4.0
2 parents 6f23cab + 2ddf110 commit 77fe508

12 files changed

Lines changed: 88 additions & 15 deletions

.github/workflows/check-standalone.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ jobs:
4242

4343
- name: Checkout lgpr package
4444
run: |
45-
git clone https://github.com/andrjohns/lgpr
46-
cd lgpr && git checkout array-syntax
45+
git clone https://github.com/jtimonen/lgpr
4746
4847
- name: Check against CRAN StanHeaders and CRAN RStan
4948
run: |

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: rstantools
22
Type: Package
33
Title: Tools for Developing R Packages Interfacing with 'Stan'
4-
Version: 2.3.1.1
5-
Date: 2023-07-18
4+
Version: 2.4.0
5+
Date: 2024-01-22
66
Authors@R:
77
c(person(given = "Jonah",
88
family = "Gabry",
@@ -53,6 +53,6 @@ Suggests:
5353
roxygen2 (>= 6.0.1),
5454
rmarkdown,
5555
rstudioapi
56-
RoxygenNote: 7.2.3
56+
RoxygenNote: 7.3.0
5757
VignetteBuilder: knitr
5858
Roxygen: list(markdown = TRUE)

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export(predictive_interval)
2424
export(prior_summary)
2525
export(rstan_config)
2626
export(rstan_create_package)
27+
export(rstantools_load_code)
2728
export(use_rstan)
2829
importFrom(RcppParallel,RcppParallelLibs)
2930
importFrom(stats,quantile)

NEWS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# rstantools 2.4.0
2+
3+
* Update to match CRAN's patched version by @jgabry in #114
4+
* Include additional template imports to suppress NOTEs by @andrjohns in #115
5+
* Fix packages with stanfunctions under rstan 2.33+ by @andrjohns in #117
6+
7+
18
# rstantools 2.3.1
29

310
* Deprecated `init_cpp`. (#105)

R/rstan_create_package.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
#' @param stan_files A character vector with paths to `.stan` files to include
4747
#' in the package.
4848
#' @param roxygen Should \pkg{roxygen2} be used for documentation? Defaults to
49-
#' `TRUE`. If so, a file `R/{pkgname}-package.R`` is added to the package with
49+
#' `TRUE`. If so, a file `R/{pkgname}-package.R` is added to the package with
5050
#' roxygen tags for the required import lines. See the **Note** section below
5151
#' for advice specific to the latest versions of \pkg{roxygen2}.
5252
#' @param travis Should a `.travis.yml` file be added to the package directory?

R/rstan_package_utils.R

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,24 @@
103103
}
104104
invisible(acc)
105105
}
106+
107+
#' Helper function for loading code in roxygenise
108+
#'
109+
#' Adapted from the \code{sourceDir} function defined
110+
#' by \code{example(source)}.
111+
#'
112+
#' @param path Path to directory containing code to load
113+
#' @param trace Whether to print file names as they are loaded
114+
#' @param ... Additional arguments passed to \code{\link{source}}
115+
#'
116+
#' @return \code{NULL}
117+
#' @export
118+
rstantools_load_code <- function(path, trace = TRUE, ...) {
119+
op <- options(); on.exit(options(op)) # to reset after each
120+
for (nm in list.files(path, pattern = "[.][RrSsQq]$")) {
121+
if (trace) cat(nm, ":")
122+
source(file.path(path, nm), ...)
123+
if (trace) cat("\n")
124+
options(op)
125+
}
126+
}

man/rstan_create_package.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.

man/rstantools-package.Rd

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

man/rstantools_load_code.Rd

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

man/use_rstan.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.

0 commit comments

Comments
 (0)