You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Calling model$expose_functions() with a CmdStanModel object results in the error message
Error in function_env$external && cmdstan_version() < "2.32" :
invalid 'x' type in 'x && y'
To Reproduce
Create a model object m.
m$expose_functions()
Expected behavior
Either expose the functions or give an informative error message.
Operating system
macOS Ventura 13.4
CmdStanR version number
0.6.0.9000
Additional context cmdstan_version() returns 2.31.0, so there should be an error message printed here. Investigating with the debugger, I find that function_env only has one name in it, compiled.
The text was updated successfully, but these errors were encountered:
I think this is the same issue as #784, where the error only occurs if the executable already exists, not anytime you create a model object. But your To Reproduce section seems to imply this always happens for you, is that right?
Does this example work?
stan_file<- write_stan_file(
" functions { real a_plus_b(real a, real b) { return a + b; } } parameters { real x; } model { x ~ std_normal(); }"
)
mod<- cmdstan_model(stan_file)
mod$expose_functions()
mod$functions$a_plus_b(1, 2)
For me this works fine. But if the executable already exists and then I create a model object I get the error you're mentioning (which we need to fix).
Describe the bug
Calling
model$expose_functions()
with aCmdStanModel
object results in the error messageTo Reproduce
m
.m$expose_functions()
Expected behavior
Either expose the functions or give an informative error message.
Operating system
macOS Ventura 13.4
CmdStanR version number
0.6.0.9000
Additional context
cmdstan_version()
returns2.31.0
, so there should be an error message printed here. Investigating with the debugger, I find thatfunction_env
only has one name in it,compiled
.The text was updated successfully, but these errors were encountered: