From 23b00f943956efb80dba8657c873fedad491a4b3 Mon Sep 17 00:00:00 2001 From: jgabry Date: Thu, 9 Mar 2023 10:15:57 -0700 Subject: [PATCH 1/3] prepare version 2.3.0 --- DESCRIPTION | 6 +++--- NAMESPACE | 1 + NEWS.md | 6 ++++-- R/rstan_create_package.R | 1 - R/rstantools-package.R | 3 ++- man-roxygen/seealso-useR2016-video.R | 3 --- man/rstan_create_package.Rd | 5 ----- man/rstantools-package.Rd | 5 ----- 8 files changed, 10 insertions(+), 20 deletions(-) delete mode 100644 man-roxygen/seealso-useR2016-video.R diff --git a/DESCRIPTION b/DESCRIPTION index 68f63c0..8dc0d93 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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-07 Authors@R: c(person(given = "Jonah", family = "Gabry", @@ -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) diff --git a/NAMESPACE b/NAMESPACE index c892383..8b761fe 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -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) diff --git a/NEWS.md b/NEWS.md index e761651..6e9e135 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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 versions of StanHeaders and rstan (#101) +* Added Andrew Johnson (@andrjohns) as an author # rstantools 2.2.0 diff --git a/R/rstan_create_package.R b/R/rstan_create_package.R index b489ea0..81f3991 100644 --- a/R/rstan_create_package.R +++ b/R/rstan_create_package.R @@ -117,7 +117,6 @@ #' on GitHub. #' @template seealso-vignettes #' @template seealso-get-help -#' @template seealso-useR2016-video #' rstan_create_package <- function(path, fields = NULL, diff --git a/R/rstantools-package.R b/R/rstantools-package.R index 7685e9f..9d4de44 100644 --- a/R/rstantools-package.R +++ b/R/rstantools-package.R @@ -18,7 +18,8 @@ #' #' @template seealso-vignettes #' @template seealso-get-help -#' @template seealso-useR2016-video +#' +#' @importFrom RcppParallel RcppParallelLibs #' NULL diff --git a/man-roxygen/seealso-useR2016-video.R b/man-roxygen/seealso-useR2016-video.R deleted file mode 100644 index 5b68928..0000000 --- a/man-roxygen/seealso-useR2016-video.R +++ /dev/null @@ -1,3 +0,0 @@ -#' @seealso -#' * The useR2016 presentation -#' [How to Use (R)Stan to Estimate Models in External R Packages.](https://channel9.msdn.com/Events/useR-international-R-User-conferences/useR-International-R-User-2017-Conference/How-to-Use-RStan-to-Estimate-Models-in-External-R-Packages) diff --git a/man/rstan_create_package.Rd b/man/rstan_create_package.Rd index f5f8070..0a6d7b0 100644 --- a/man/rstan_create_package.Rd +++ b/man/rstan_create_package.Rd @@ -156,9 +156,4 @@ can be found in the vignettes included with \pkg{rstantools} and at your package let us know on the the \href{https://discourse.mc-stan.org}{Stan Forums} or at the \pkg{rstantools} GitHub \href{https://github.com/stan-dev/rstantools/issues}{issue tracker}. } - -\itemize{ -\item The useR2016 presentation -\href{https://channel9.msdn.com/Events/useR-international-R-User-conferences/useR-International-R-User-2017-Conference/How-to-Use-RStan-to-Estimate-Models-in-External-R-Packages}{How to Use (R)Stan to Estimate Models in External R Packages.} -} } diff --git a/man/rstantools-package.Rd b/man/rstantools-package.Rd index cd8afae..b1532b0 100644 --- a/man/rstantools-package.Rd +++ b/man/rstantools-package.Rd @@ -30,9 +30,4 @@ can be found in the vignettes included with \pkg{rstantools} and at your package let us know on the the \href{https://discourse.mc-stan.org}{Stan Forums} or at the \pkg{rstantools} GitHub \href{https://github.com/stan-dev/rstantools/issues}{issue tracker}. } - -\itemize{ -\item The useR2016 presentation -\href{https://channel9.msdn.com/Events/useR-international-R-User-conferences/useR-International-R-User-2017-Conference/How-to-Use-RStan-to-Estimate-Models-in-External-R-Packages}{How to Use (R)Stan to Estimate Models in External R Packages.} -} } From bdb3b2cdc62c35d93ff14e2807127e93f25c9c08 Mon Sep 17 00:00:00 2001 From: jgabry Date: Thu, 9 Mar 2023 10:22:17 -0700 Subject: [PATCH 2/3] bump Date --- DESCRIPTION | 2 +- R/rstan_config.R | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 8dc0d93..0c5ac3e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: rstantools Type: Package Title: Tools for Developing R Packages Interfacing with 'Stan' Version: 2.3.0 -Date: 2023-03-07 +Date: 2023-03-09 Authors@R: c(person(given = "Jonah", family = "Gabry", diff --git a/R/rstan_config.R b/R/rstan_config.R index 0b260d0..fd4ecc0 100644 --- a/R/rstan_config.R +++ b/R/rstan_config.R @@ -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) { @@ -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, @@ -393,5 +393,5 @@ rstan_config <- function(pkgdir = ".") { # type with double rtn_type <- gsub("template ", "", 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) } From 8a9c46f9c6e9f3d49ed84c8f1c7c180785784cda Mon Sep 17 00:00:00 2001 From: jgabry Date: Thu, 9 Mar 2023 10:46:14 -0700 Subject: [PATCH 3/3] Update NEWS.md --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 6e9e135..e704587 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,7 +1,7 @@ # rstantools 2.3.0 * Updated C++ standard to C++17 (#100) -* Updated the handling of exporting standalone stan functions in packages for compatibility with the 2.26 versions of StanHeaders and rstan (#101) +* 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