Cmdstanr: --include-paths warning in cmdstan 2.24

Created on 21 Jul 2020  路  5Comments  路  Source: stan-dev/cmdstanr

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.

bug

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.

All 5 comments

@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:

  1. Provide it as a default if no include_path is specified, but don't auto-include if the user specifies an include_path argument
  2. Append it to the paths, even if the user provides their own include_path

Which 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:

  1. Provide it as a default if no include_path is specified, but don't auto-include if the user specifies an include_path argument
  2. 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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rok-cesnovar picture rok-cesnovar  路  12Comments

SteveBronder picture SteveBronder  路  7Comments

bbbales2 picture bbbales2  路  4Comments

wlandau picture wlandau  路  12Comments

andrjohns picture andrjohns  路  6Comments