Skip to content

Commit

Permalink
Merge pull request #104 from stan-dev/v2.3.0
Browse files Browse the repository at this point in the history
Version 2.3.0
  • Loading branch information
jgabry authored Mar 9, 2023
2 parents 0ae1349 + 8a9c46f commit 59bd318
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 25 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: rstantools
Type: Package
Title: Tools for Developing R Packages Interfacing with 'Stan'
Version: 2.2.0.9000
Date: 2022-04-05
Version: 2.3.0
Date: 2023-03-09
Authors@R:
c(person(given = "Jonah",
family = "Gabry",
Expand Down Expand Up @@ -53,6 +53,6 @@ Suggests:
roxygen2 (>= 6.0.1),
rmarkdown,
rstudioapi
RoxygenNote: 7.1.2
RoxygenNote: 7.2.2
VignetteBuilder: knitr
Roxygen: list(markdown = TRUE)
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ export(prior_summary)
export(rstan_config)
export(rstan_create_package)
export(use_rstan)
importFrom(RcppParallel,RcppParallelLibs)
importFrom(stats,quantile)
importFrom(stats,var)
6 changes: 4 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# rstantools 2.2.9000
# rstantools 2.3.0

Items for next release go here
* Updated C++ standard to C++17 (#100)
* Updated the handling of exporting standalone stan functions in packages for compatibility with the 2.26 (and beyond) versions of StanHeaders and rstan (#101)
* Added Andrew Johnson (@andrjohns) as an author

# rstantools 2.2.0

Expand Down
10 changes: 5 additions & 5 deletions R/rstan_config.R
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ rstan_config <- function(pkgdir = ".") {
all_files <- list.files(file.path(pkgdir, "src"), full.names = FALSE)
# reduce to stan model files
src_files <- all_files[grepl("*[.](cc|h)$", all_files)]
src_files <- src_files[grepl(.stan_prefix(start=TRUE), src_files)]
src_files <- src_files[grepl(.stan_prefix(start = TRUE), src_files)]
# make sure 1st line is "don't edit"
src_line1 <- sapply(file.path(pkgdir, "src", src_files), readLines, n = 1)
src_files <- src_files[(src_line1 == .rstantools_noedit("foo.h")) |
(src_line1 == .rstantools_noedit("foo.cc"))]
# stan model names corresponding to inactive stan files
rm_names <- gsub(.stan_prefix(start=TRUE), "", src_files)
rm_names <- gsub(.stan_prefix(start = TRUE), "", src_files)
rm_names <- unique(gsub("[.](cc|h)$", "", rm_names))
rm_names <- rm_names[!(rm_names %in% gsub("[.]stan$", "", stan_files))]
if (length(rm_names) > 0) {
Expand Down Expand Up @@ -355,8 +355,8 @@ rstan_config <- function(pkgdir = ".") {
.replace_auto <- function(decl_line, next_decl, cppcode, cpp_lines) {
# Extract the name of function
fun_name <- paste0(cpp_lines[decl_line:next_decl], collapse = " ")
fun_name <- gsub("auto ","",fun_name,fixed=T)
fun_name <- sub("\\(.*","",fun_name,perl=T)
fun_name <- gsub("auto ", "", fun_name, fixed = TRUE)
fun_name <- sub("\\(.*", "", fun_name, perl = TRUE)

# Depending on the version of stanc3, the standalone functions
# with a plain return type can either be wrapped in a struct as a functor,
Expand Down Expand Up @@ -393,5 +393,5 @@ rstan_config <- function(pkgdir = ".") {
# type with double
rtn_type <- gsub("template <typename(.*?)> ", "", repl_dbl)
# Update model code with type declarations
gsub("auto", rtn_type, cpp_lines[decl_line], fixed=T)
gsub("auto", rtn_type, cpp_lines[decl_line], fixed = TRUE)
}
1 change: 0 additions & 1 deletion R/rstan_create_package.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@
#' on GitHub.
#' @template seealso-vignettes
#' @template seealso-get-help
#' @template seealso-useR2016-video
#'
rstan_create_package <- function(path,
fields = NULL,
Expand Down
3 changes: 2 additions & 1 deletion R/rstantools-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
#'
#' @template seealso-vignettes
#' @template seealso-get-help
#' @template seealso-useR2016-video
#'
#' @importFrom RcppParallel RcppParallelLibs
#'
NULL

Expand Down
3 changes: 0 additions & 3 deletions man-roxygen/seealso-useR2016-video.R

This file was deleted.

5 changes: 0 additions & 5 deletions man/rstan_create_package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions man/rstantools-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 59bd318

Please sign in to comment.