diff --git a/.Rbuildignore b/.Rbuildignore index 8c1f77aa..594cc272 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -12,3 +12,4 @@ ^\.github$ ^vignettes/articles-online-only$ ^release-prep\.R$ +^\.vscode$ diff --git a/DESCRIPTION b/DESCRIPTION index 4aedc431..ca2fd596 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: cmdstanr Title: R Interface to 'CmdStan' -Version: 0.7.1 -Date: 2024-01-09 +Version: 0.8.0 +Date: 2024-05-18 Authors@R: c(person(given = "Jonah", family = "Gabry", role = "aut", email = "jsg2201@columbia.edu"), @@ -36,7 +36,7 @@ RoxygenNote: 7.3.1 Roxygen: list(markdown = TRUE, r6 = FALSE) SystemRequirements: CmdStan (https://mc-stan.org/users/interfaces/cmdstan) Depends: - R (>= 4.0.0) + R (>= 3.5.0) Imports: checkmate, data.table, diff --git a/NEWS.md b/NEWS.md index d1b65065..aa659b83 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,10 +1,46 @@ -# cmdstanr 0.7.0.9000 +# cmdstanr 0.8.0.9000 Items for next release go here +# cmdstanr 0.8.0 + +## Major new features + +* Add functionality for passing `CmdStanFit` objects as initial values by @SteveBronder in #937 + +## Other improvements + +* Add compatibility with CmdStan 2.35 by @andrjohns in #972 +* Add `show_messages` and `show_exceptions` arguments to all methods for controlling output by @andrjohns in #897 +* Drop RcppEigen dependency, implement basic Eigen -> C++ interop by @andrjohns in #899 +* Add compatibility with CmdStan 2.34 by @andrjohns in #905 #910 +* Add a format argument to the `unconstrain_draws()` method to specify draws format of return by @andrjohns in #886 +* Align `cmdstanr` EBFMI diagnostic threshold with CmdStan by @andrjohns in #892 +* Add global option `cmdstanr_print_line_numbers` to add line number to model printing by @sbfnk in #967 +* Add new CmdStan arguments `save_metric` and `save_cmdstan_config` by @venpopov in #932 +* Add documentation for CmdStanR global options by @jgabry in #951 +* Add documentation for how to obtain structured output similar to `rstan::extract()` using a combination of `cmdstanr` and `posterior` by @jgabry in #955 +* Added coercion generics for CmdStanFit objects by @gowerc in #943 +* `psis_resample` and `calculate_lp` arguments added to Pathfinder method by @SteveBronder in #903 +* Documentation and tests for LOO method updated by @jgabry in #923 +* Global option `cmdstanr_warn_inits` added to disable warnings about partially specified initial values by @jgabry in #913 +* Updates to MCMC `output_dir` documentation by @jgabry in #929 + +## Bugfixes + +* Fix broken link in OpenCL documentation by @eipi10 in #908 +* Fix a minor typo in the README by @jgabry in #911 +* Make exported RNG functions respect changes to R's seed by @andrjohns in #973 +* Optimisations for model methods functions by @andrjohns in #960 +* Bugfix for passing function for initial values with Pathfinder method and default `num_paths` by @andrjohns in #964 +* Continue with compilation if `compile_stanalone=TRUE` but no functions are found by @jgabry in #956 +* Update tests and CI for compatibility with MacOS ARM64 by @andrjohns in #958 +* Fix handling of `inv_metric` argument with only 1 parameter by @venpopov in #935 +* Fixes for compatibility with RTools44 by @andrjohns in #952 #959 + # cmdstanr 0.7.0 -## Major new features +## Major new features * New `laplace` method by @jgabry in #800 * New `pathfinder` method by @SteveBronder in #848 @@ -47,7 +83,7 @@ Items for next release go here ### Major new features * New `expose_functions()` method to expose Stan functions to R by @andrjohns in #702. See `?expose_functions`. -* New methods for accessing log_prob, grad_log_prob, hessian, un/constrain variables by @andrjohns in #701. See `?init_model_methods`. +* New methods for accessing log_prob, grad_log_prob, hessian, un/constrain variables by @andrjohns in #701. See `?init_model_methods`. ### Other changes diff --git a/R/model.R b/R/model.R index 0a1cb1c1..8db71a17 100644 --- a/R/model.R +++ b/R/model.R @@ -212,7 +212,7 @@ cmdstan_model <- function(stan_file = NULL, exe_file = NULL, compile = TRUE, ... #' |**Method**|**Description**| #' |:----------|:---------------| #' [`$sample()`][model-method-sample] | Run CmdStan's `"sample"` method, return [`CmdStanMCMC`] object. | -#' [`$sample_mpi()`][model-method-sample_mpi] | Run CmdStan's `"sample"` method with [MPI](https://mc-stan.org/math/mpi.html), return [`CmdStanMCMC`] object. | +#' [`$sample_mpi()`][model-method-sample_mpi] | Run CmdStan's `"sample"` method with [MPI](https://mc-stan.org/math/md_doxygen_2parallelism__support_2mpi__parallelism.html), return [`CmdStanMCMC`] object. | #' [`$optimize()`][model-method-optimize] | Run CmdStan's `"optimize"` method, return [`CmdStanMLE`] object. | #' [`$variational()`][model-method-variational] | Run CmdStan's `"variational"` method, return [`CmdStanVB`] object. | #' [`$pathfinder()`][model-method-pathfinder] | Run CmdStan's `"pathfinder"` method, return [`CmdStanPathfinder`] object. | diff --git a/R/path.R b/R/path.R index a887a617..15bbeae6 100644 --- a/R/path.R +++ b/R/path.R @@ -115,9 +115,9 @@ cmdstan_default_install_path <- function(old = FALSE, wsl = FALSE) { file.path(paste0(wsl_dir_prefix(wsl = TRUE), wsl_home_dir()), ".cmdstan") } else { if (old) { - file.path(Sys.getenv("HOME"), ".cmdstanr") + file.path(.home_path(), ".cmdstanr") } else { - file.path(Sys.getenv("HOME"), ".cmdstan") + file.path(.home_path(), ".cmdstan") } } } @@ -240,3 +240,16 @@ fake_cmdstan_version <- function(version) { reset_cmdstan_version <- function() { .cmdstanr$VERSION <- read_cmdstan_version(cmdstan_path()) } + +.home_path <- function() { + home <- Sys.getenv("HOME") + if (os_is_windows()) { + userprofile <- Sys.getenv("USERPROFILE") + h_drivepath <- file.path(Sys.getenv("HOMEDRIVE"), Sys.getenv("HOMEPATH")) + win_home <- ifelse(userprofile == "", h_drivepath, userprofile) + if (win_home != "") { + home <- win_home + } + } + home +} diff --git a/README.md b/README.md index b3269eaa..7f9b54a4 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ releases. * Modularity: CmdStanR runs Stan's algorithms and lets downstream modules do the analysis. -* Flexible [BSD-3 license](https://opensource.org/license/bsd-3-clause/). +* Flexible [BSD-3 license](https://opensource.org/license/bsd-3-clause). ### Installation diff --git a/man/CmdStanModel.Rd b/man/CmdStanModel.Rd index 8bb3fdaf..3bacdd50 100644 --- a/man/CmdStanModel.Rd +++ b/man/CmdStanModel.Rd @@ -44,7 +44,7 @@ methods, many of which have their own (linked) documentation pages: \subsection{Model fitting}{\tabular{ll}{ \strong{Method} \tab \strong{Description} \cr \code{\link[=model-method-sample]{$sample()}} \tab Run CmdStan's \code{"sample"} method, return \code{\link{CmdStanMCMC}} object. \cr - \code{\link[=model-method-sample_mpi]{$sample_mpi()}} \tab Run CmdStan's \code{"sample"} method with \href{https://mc-stan.org/math/mpi.html}{MPI}, return \code{\link{CmdStanMCMC}} object. \cr + \code{\link[=model-method-sample_mpi]{$sample_mpi()}} \tab Run CmdStan's \code{"sample"} method with \href{https://mc-stan.org/math/md_doxygen_2parallelism__support_2mpi__parallelism.html}{MPI}, return \code{\link{CmdStanMCMC}} object. \cr \code{\link[=model-method-optimize]{$optimize()}} \tab Run CmdStan's \code{"optimize"} method, return \code{\link{CmdStanMLE}} object. \cr \code{\link[=model-method-variational]{$variational()}} \tab Run CmdStan's \code{"variational"} method, return \code{\link{CmdStanVB}} object. \cr \code{\link[=model-method-pathfinder]{$pathfinder()}} \tab Run CmdStan's \code{"pathfinder"} method, return \code{\link{CmdStanPathfinder}} object. \cr