Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate "cores" before compiling #576

Closed
rpsychologist opened this issue Dec 19, 2018 · 1 comment
Closed

Validate "cores" before compiling #576

rpsychologist opened this issue Dec 19, 2018 · 1 comment

Comments

@rpsychologist
Copy link

This issue is just a minor thing, but changing it would improve the user experience. Currently, the argument "cores" is not validated, hence if it is invalid the model will first compile but then fail and throw an error. This behavior can be annoying if you are stupid like me and, e.g., pass an object that does not exist as an argument, thinking that the model will sample while I go and grab a cup of coffee. ;)

brm(count ~ log_Age_c + log_Base4_c * Trt + (1|patient),
    data = epilepsy, 
    family = poisson(), 
    cores = cores)
## Compiling the C++ model
## Start sampling
## Error in nlist(chains, cores) : object 'cores' not found
paul-buerkner added a commit that referenced this issue Dec 19, 2018
@paul-buerkner
Copy link
Owner

Good point. While I was at it, I also added early validity checks for a bunch of other arguments which were otherwise only evaluated after compiling a model. The next coffee break will hopefully be more effective ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants