When constructing a Stanmodel, I always get File myfile.stan will be updated. even when the model hasn't changed.
It seems, this comes from the fact that the parse_and_interpolate function always appends a newline \n at the end of the model string.
Hence, in function update_model_file, if model has no trailing \n, model1 has one\n and is written out. Next time, model2 then has two trailing \n. In the end, model1 will never be equal to model2.
Guess, changing line 30 in update_model_file.jl to model2 = parse_and_interpolate(strip(read(file, String))) could help.
When constructing a
Stanmodel
, I always getFile myfile.stan will be updated.
even when the model hasn't changed. It seems, this comes from the fact that theparse_and_interpolate
function always appends a newline\n
at the end of the model string. Hence, in functionupdate_model_file
, ifmodel
has no trailing\n
,model1
has one\n
and is written out. Next time,model2
then has two trailing\n
. In the end,model1
will never be equal tomodel2
. Guess, changing line 30 inupdate_model_file.jl
tomodel2 = parse_and_interpolate(strip(read(file, String)))
could help.