StatisticalRethinkingJulia / TuringModels.jl

Implementations of the models from the Statistical Rethinking book with Turing.jl
https://statisticalrethinkingjulia.github.io/TuringModels.jl/
MIT License
163 stars 18 forks source link

Rename chains to chn #64

Closed rikhuijzer closed 3 years ago

rikhuijzer commented 3 years ago

In the scripts, the variable chains is used all over the place. Unfortunately, chains is also exported by MCMCChains, which can cause issues like

julia> chains = sample(model(a, b), NUTS(0.65), 1000)
ERROR: invalid redefinition of constant chains

Thanks to David Widmann for figuring this out (https://github.com/TuringLang/Turing.jl/issues/1529).

To solve this issue, and avoid problems in the future for us and for users, we would be better of renaming the variables to chn or chns or something.

BobinMathew commented 3 years ago

Hi @rikhuijzer I would like to solve this issue 😀

rikhuijzer commented 3 years ago

Okay and thanks. I'll won't work on it then :+1: Looking forward to your pull request

rikhuijzer commented 3 years ago

Feel free to mail me or comment here if you have any questions