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

diagnose exit code #1278

Open
jsks opened this issue May 30, 2024 · 3 comments
Open

diagnose exit code #1278

jsks opened this issue May 30, 2024 · 3 comments

Comments

@jsks
Copy link

jsks commented May 30, 2024

Currently, the diagnose utility prints all output to stdout and returns 0 regardless of warnings. Would it make sense to return a non-zero exit status if there's an error with any of the checks?

This would make it easier to programmatically distinguish CmdStan runs with diagnostic warnings in the shell. As far as I know, currently the diagnose output needs to be checked manually or the output loaded into one of the programming language specific packages.

The return line in diagnose.cpp can just return the bool value from the variable has_error, or a more specific exit code can be used.

@mitzimorris
Copy link
Member

the diagnose command detects potential errors - it returns warnings.
however, your point is valid - the return code could be used to signal warnings / no_warnings.

regarding the diagnose utility - I think that it's probably due for updates - it was written circa 2016 and reflects the thinking then. cf https://discourse.mc-stan.org/t/is-the-diagnose-utility-deprecated/2312. there are a bunch of case studies by Michael Betancourt on these diagnostics. also, some discussion in the "Visualization in Bayesian Workflow" paper of Gabry et al - https://arxiv.org/abs/1709.01449

@WardBrian
Copy link
Member

I think it would make sense to something similar to grep:

0 - no problem
1 - warning raised
2 - internal error/exception, not a problem with this specific set of draws

@WardBrian WardBrian reopened this Nov 4, 2024
@WardBrian
Copy link
Member

Sorry, misread the original issue

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

No branches or pull requests

3 participants