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
I believe the problem comes from this line. Shouldn't it read if compile or self._exe_file is None instead of the current if compile and self._exe_file is None? As written, force_compile will only actually force compilation if no exe file is provided, which kind of defeats the point IMO. Changing the "and" to an "or" results in a compilation if force_compile = True OR if force_compile = False and no executable was provided.
Current Version:
The referenced code issue is in the main branch. Probably not helpful, but here's the info for what I'm working with:
Why are you providing a path to the exe file if you don't want it to use that file? I think it would be reasonable to make the change you suggest, but I'd also be tempted to make this combination of arguments raise an exception.
Note that we will (eventually) have a breaking change to the model class constructor which will likely end up fixing this by accident, c.f. #695
I have a child class of CmdStanModel that looks for an executable file of the same name as the stan file and passes it in as the exe argument if it finds one. I can certainly work around this with minor changes to the child class, but the documentation for CmdStanModel states for force_compile, "If True, always compile, even if there is an existing executable file for this model." To me, this means that force_compile = True will override all other arguments to CmdStanModel and force creation of a new executable from the passed stan file. Perhaps I'm just misinterpreting the documentation?
Summary:
Title describes the problem :)
Description:
I believe the problem comes from this line. Shouldn't it read
if compile or self._exe_file is None
instead of the currentif compile and self._exe_file is None
? As written,force_compile
will only actually force compilation if no exe file is provided, which kind of defeats the point IMO. Changing the "and" to an "or" results in a compilation ifforce_compile = True
OR ifforce_compile = False
and no executable was provided.Current Version:
The referenced code issue is in the main branch. Probably not helpful, but here's the info for what I'm working with:
INSTALLED VERSIONS
python: 3.12.5 | packaged by conda-forge | (main, Aug 8 2024, 18:36:51) [GCC 12.4.0]
python-bits: 64
OS: Linux
OS-release: 6.5.0-35-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: ('en_US', 'UTF-8')
cmdstan_folder: /home/bwittmann/micromamba/envs/dms_stan/bin/cmdstan
cmdstan: (2, 33)
cmdstanpy: 1.2.4
pandas: 2.2.2
xarray: 2023.6.0
tqdm: 4.66.4
numpy: 1.26.4
' '
The text was updated successfully, but these errors were encountered: