Skip to content

Commit

Permalink
v2.11 - update for cmdstanr v0.0.0.9006
Browse files Browse the repository at this point in the history
-fixes deprecated stuff in latest cmdstanr. this breaks my old exe caching code, so will need to figure out a new way to accomplish that.
  • Loading branch information
Richard McElreath committed Jun 26, 2020
1 parent a6d2438 commit 89b3e63
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: rethinking
Type: Package
Title: Statistical Rethinking book package
Version: 2.10
Date: 2020-05-13
Version: 2.11
Date: 2020-06-26
Author: Richard McElreath
Maintainer: Richard McElreath <richard_mcelreath@eva.mpg.de>
Imports: coda, MASS, mvtnorm, loo, shape
Expand Down
6 changes: 3 additions & 3 deletions R/ulam-function.R
Original file line number Diff line number Diff line change
Expand Up @@ -1410,11 +1410,11 @@ ulam <- function( flist , data , pars , pars_omit , start , chains=1 , cores=1 ,
filex <- cmdstanr_model_write( model_code )
mod <- cmdstan_model(
stan_file=filex[[1]],
exe_file=filex[[2]],
# exe_file=filex[[2]],
compile=filex[[3]],
cpp_options=list(stan_threads=TRUE) )
set_num_threads( threads )
cmdstanfit <- mod$sample( data=data , chains=chains , cores=cores , iter_sampling=iter , adapt_delta=as.numeric(control[['adapt_delta']]) , ... )
# set_num_threads( threads )
cmdstanfit <- mod$sample( data=data , chains=chains , parallel_chains=cores , iter_sampling=iter , adapt_delta=as.numeric(control[['adapt_delta']]) , threads_per_chain=threads , ... )

This comment has been minimized.

Copy link
@jgabry

jgabry Jun 26, 2020

@rmcelreath sorry we keep deprecating stuff in CmdStanR! We're getting close to beta release, after which deprecation should be rare. Glad you're going to offer CmdStanR as a backend!

This comment has been minimized.

Copy link
@rmcelreath

rmcelreath Jun 26, 2020

Owner

It's all good. I knew what I was getting into. I haven't migrated the cmdstanr support to master branch yet, because I imagined stuff like this would happen.

stanfit <- rstan::read_stan_csv(cmdstanfit$output_files())
}
} else
Expand Down
2 changes: 1 addition & 1 deletion tests/rethinking_tests/test_cmdstanr_threads.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ m2 <- ulam(
a ~ normal(0,1.5),
b ~ normal(0,0.5)
) , data=dat ,
cmdstan=TRUE , threads=2 , chains=1 , cores=1 , refresh=1000 )
cmdstan=TRUE , threads=2 , chains=2 , cores=2 , refresh=1000 )

# hierarchical version
N_id <- round(N/10)
Expand Down

0 comments on commit 89b3e63

Please sign in to comment.