Describe the bug
Trying out cmdstan 2.24.0 rc1, I get the warning "--include_paths is deprecated. Please use --include-paths."
To Reproduce
First, install cmdstan 2.24.0-rc1
Then:
library(cmdstanr)
file <- file.path(cmdstan_path(), "examples", "bernoulli", "bernoulli.stan")
mod <- cmdstan_model(file, include_paths=".", force_recompile=TRUE)
#> Compiling Stan program...
#> --include_paths is deprecated. Please use --include-paths.
#> Then lots of compiler warnings, probably unrelated
Expected behavior
No include_paths warning.
Operating system
Ubuntu 20.04
CmdStanR version number
0.0.0.9008 (e33e2b4)
Additional context
Minor request: it would be convenient if include_paths included the directory of the model file, as mentioned in https://github.com/stan-dev/cmdstanr/issues/59#issuecomment-549008393, but it's not a big deal.
@karldw Thanks for reporting this and for testing out the release candidate!
@rok-cesnovar's PR #246 should take care of the include_paths warning.
Regarding the minor request for including the directory of the model file in the include paths, I do think you're right that this would be preferable, however I can imagine cases when the user wouldn't want that. If we did include the model file directory without the user needing to manually specify it, then how would the user specify not to include it if they don't want it?
Sorry I missed that PR!
There are two ways I could imagine auto-including the model directory:
include_path is specified, but don't auto-include if the user specifies an include_path argumentinclude_pathWhich are you thinking of?
In the case (1), a simple way to specify no include directories might be include_paths = "" or include_paths = FALSE.
If (2), I'm having a hard time thinking of something simpler than adding an argument, something like include_model_directory, with default TRUE.
Sorry I missed that PR!
I don't think you missed it, I think @rok-cesnovar is just really fast ;)
There are two ways I could imagine auto-including the model directory:
- Provide it as a default if no
include_pathis specified, but don't auto-include if the user specifies aninclude_pathargument- Append it to the paths, even if the user provides their own
include_path
Yeah (2) was what I was concerned about. I think (1) is a good option, but maybe we should make that the behavior in CmdStan itself (or really in stanc3 as Rok will rightly point out) rather than changing it only in CmdStanR?
Yes, I think the stanc transpiler should, in case of includes in the model and no include paths provided, check if they exist in the folder of the model and use those.
Sounds great! I'll close this issue then. Let me know if it would be helpful to open one in the stanc3 repo.
Most helpful comment
Yes, I think the stanc transpiler should, in case of includes in the model and no include paths provided, check if they exist in the folder of the model and use those.