save_metric_files: fix doc and error message, and add tests #1021
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Submission Checklist
Summary
Fixes the doc to say that
save_metric
is FALSE by default and adds informative error message whensave_metric_files()
fails due to not having save the files. This was pointed out on the forum by @mippeqf: https://discourse.mc-stan.org/t/saving-metric-files-in-cmdstanr/36160.@andrjohns with arguments like this we've been setting the default to
NULL
and just using the CmdStan default and in this case CmdStan defaults to not saving the metric files. But we could think about overriding the CmdStan default and set it to default toTRUE
in CmdStanR. The downside is that this would be inconsistent with how we're treating most other arguments passed to CmdStan and it would save more files that most users never care about. The upside would be that it would save specific users the hassle of fitting a slow model and then realizing the default issave_metric=FALSE
. I would lean towards just doing what I did in this PR and documenting that it'ssave_metric=FALSE
by default, but I'm also open to changing the default.Copyright and Licensing
Please list the copyright holder for the work you are submitting
(this will be you or your assignee, such as a university or company):
Columbia University
By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the following licenses: