Skip to content

Commit 7daf92b

Browse files
committed
Merge branch 'master' into pr/839
2 parents f0812a1 + b29374e commit 7daf92b

45 files changed

Lines changed: 306 additions & 328 deletions

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-wsl.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
token: ${{ secrets.GITHUB_TOKEN }}
3636
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"
3737

38-
- uses: actions/checkout@v3
38+
- uses: actions/checkout@v4
3939

4040
- uses: r-lib/actions/setup-r@v2.6.4
4141
with:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
token: ${{ secrets.GITHUB_TOKEN }}
4949
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"
5050

51-
- uses: actions/checkout@v3
51+
- uses: actions/checkout@v4
5252

5353
- name: Install system dependencies
5454
if: runner.os == 'Linux'

.github/workflows/Test-coverage.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
token: ${{ secrets.GITHUB_TOKEN }}
3333
workflow: Test-coverage.yml
3434
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"
35-
- uses: actions/checkout@v3
35+
- uses: actions/checkout@v4
3636

3737
- uses: r-lib/actions/setup-r@v2.6.4
3838
- uses: r-lib/actions/setup-pandoc@v2.6.4
@@ -83,7 +83,7 @@ jobs:
8383
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
8484
NOT_CRAN: true
8585
steps:
86-
- uses: actions/checkout@v3
86+
- uses: actions/checkout@v4
8787

8888
- uses: r-lib/actions/setup-r@v2.6.4
8989
with:

.github/workflows/cmdstan-tarball-check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
NOT_CRAN: true
3333

3434
steps:
35-
- uses: actions/checkout@v3
35+
- uses: actions/checkout@v4
3636
- name: Install system dependencies
3737
if: runner.os == 'Linux'
3838
run: |

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: cmdstanr
22
Title: R Interface to 'CmdStan'
3-
Version: 0.6.0.9000
4-
Date: 2023-07-25
3+
Version: 0.6.1.9000
4+
Date: 2023-08-25
55
Authors@R:
66
c(person(given = "Jonah", family = "Gabry", role = c("aut", "cre"),
77
email = "jsg2201@columbia.edu"),

NEWS.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1-
# cmdstanr 0.6.0.9000
1+
# cmdstanr 0.6.1.9000
2+
3+
# cmdstanr 0.6.1
4+
5+
* Store return codes instead of always querying exit status by @jgabry in #798
6+
* enable jacobian argument for optimization by @jgabry in #799
7+
* Fix init_model_methods for models with no data by @andrjohns in #801
8+
* Document a CmdStan-focused way to pre-compile Stan models in R packages by @wlandau in #809
9+
* Describe how to efficiently save model fit objects by @wlandau in #816
10+
* fix errors in doc for new methods by @jgabry in #823
11+
* Give informative error when exposing stan functions with precompiled model by @andrjohns in #831
12+
* Bugfixes in .stanfunctions, hessian model method, and exposing RNG functions by @andrjohns in #811
13+
* Fix variable_skeleton() with containers by @andrjohns in #832
14+
* Improve handling of user header by @martinmodrak in #818
15+
* change duplicate stdout_file to stderr_file by @jgabry in #834
216

3-
Items for next release
417

518
# cmdstanr 0.6.0
619

R/example.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ print_example_program <-
124124
#' stan_program <- "
125125
#' data {
126126
#' int<lower=0> N;
127-
#' int<lower=0,upper=1> y[N];
127+
#' array[N] int<lower=0,upper=1> y;
128128
#' }
129129
#' parameters {
130130
#' real<lower=0,upper=1> theta;

R/fit.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,7 +1158,7 @@ CmdStanFit$set("public", name = "return_codes", value = return_codes)
11581158
#' mcmc_program <- write_stan_file(
11591159
#' 'data {
11601160
#' int<lower=0> N;
1161-
#' int<lower=0,upper=1> y[N];
1161+
#' array[N] int<lower=0,upper=1> y;
11621162
#' }
11631163
#' parameters {
11641164
#' real<lower=0,upper=1> theta;
@@ -1169,7 +1169,7 @@ CmdStanFit$set("public", name = "return_codes", value = return_codes)
11691169
#' }
11701170
#' }
11711171
#' generated quantities {
1172-
#' int y_rep[N];
1172+
#' array[N] int y_rep;
11731173
#' profile("gq") {
11741174
#' y_rep = bernoulli_rng(rep_vector(theta, N));
11751175
#' }

R/model.R

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,12 @@ cmdstan_model <- function(stan_file = NULL, exe_file = NULL, compile = TRUE, ...
190190
#' [`$save_hpp_file()`][model-method-compile] | Save the `.hpp` file containing the generated C++ code. |
191191
#' [`$expose_functions()`][model-method-expose_functions] | Expose Stan functions for use in R. |
192192
#'
193+
#' ## Diagnostics
194+
#'
195+
#' |**Method**|**Description**|
196+
#' |:----------|:---------------|
197+
#' [`$diagnose()`][model-method-diagnose] | Run CmdStan's `"diagnose"` method to test gradients, return [`CmdStanDiagnose`] object. |
198+
#'
193199
#' ## Model fitting
194200
#'
195201
#' |**Method**|**Description**|
@@ -800,7 +806,7 @@ CmdStanModel$set("public", name = "variables", value = variables)
800806
#' file <- write_stan_file("
801807
#' data {
802808
#' int N;
803-
#' int y[N];
809+
#' array[N] int y;
804810
#' }
805811
#' parameters {
806812
#' // should have <lower=0> but omitting to demonstrate pedantic mode
@@ -926,7 +932,7 @@ CmdStanModel$set("public", name = "check_syntax", value = check_syntax)
926932
#' file <- write_stan_file("
927933
#' data {
928934
#' int N;
929-
#' int y[N];
935+
#' array[N] int y;
930936
#' }
931937
#' parameters {
932938
#' real lambda;
@@ -1653,7 +1659,7 @@ CmdStanModel$set("public", name = "variational", value = variational)
16531659
#' mcmc_program <- write_stan_file(
16541660
#' "data {
16551661
#' int<lower=0> N;
1656-
#' int<lower=0,upper=1> y[N];
1662+
#' array[N] int<lower=0,upper=1> y;
16571663
#' }
16581664
#' parameters {
16591665
#' real<lower=0,upper=1> theta;
@@ -1672,13 +1678,13 @@ CmdStanModel$set("public", name = "variational", value = variational)
16721678
#' gq_program <- write_stan_file(
16731679
#' "data {
16741680
#' int<lower=0> N;
1675-
#' int<lower=0,upper=1> y[N];
1681+
#' array[N] int<lower=0,upper=1> y;
16761682
#' }
16771683
#' parameters {
16781684
#' real<lower=0,upper=1> theta;
16791685
#' }
16801686
#' generated quantities {
1681-
#' int y_rep[N] = bernoulli_rng(rep_vector(theta, N));
1687+
#' array[N] int y_rep = bernoulli_rng(rep_vector(theta, N));
16821688
#' }"
16831689
#' )
16841690
#'

R/run.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,8 +560,8 @@ CmdStanRun$set("private", name = "run_variational_", value = .run_other)
560560
if (file.exists(stdout_file)) {
561561
cat(readLines(stdout_file), sep = "\n")
562562
}
563-
if (file.exists(stdout_file)) {
564-
cat(readLines(stdout_file), sep = "\n")
563+
if (file.exists(stderr_file)) {
564+
cat(readLines(stderr_file), sep = "\n")
565565
}
566566
stop(
567567
"Diagnose failed with the status code ", ret$status, "!\n",

0 commit comments

Comments
 (0)