Informative error message if temp csv files not found by Quarto#1178
Informative error message if temp csv files not found by Quarto#1178
Conversation
…to rendering Fixes #1012
| error = function(e) { | ||
| err_msg <- conditionMessage(e) | ||
| if (isTRUE(getOption("knitr.in.progress")) && | ||
| isTRUE(self$runset$args$using_tempdir) && |
There was a problem hiding this comment.
If we do it here instead of inside read_cmdstan_csv() we can access the internal using_tempdir flag, which is more reliable than checking getOption(cmdstan_output_dir) because the option may have changed between the initial quarto caching and the later re-rendering (so it's not a 100% reliable indicator of whether the temp directory was used).
|
@avehtari This PR is more complicated than yours because with this strategy we need to do it for every different type of fitted model object (mcmc, mle, pathfinder, etc.). In your version we could just do it in |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1178 +/- ##
==========================================
- Coverage 91.23% 91.10% -0.14%
==========================================
Files 15 15
Lines 6070 6116 +46
==========================================
+ Hits 5538 5572 +34
- Misses 532 544 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This PR doesn't do anything for me |
|
Weird, it worked when I tried it. But I did make a few edits after testing it so maybe I broke it. I’ll investigate. |
|
@avehtari Was your fitted model object created using the cmdstanr from this branch or did you already have it from before? It needs to be created using this version of cmdstanr on this branch because of the way R6 objects work |
|
I did switch to this branch, rendered without cache which should then crearte fit object with this branch, and then rendered with cache |
|
Ok interesting, I’ll try to figure it out later when I have some time. Maybe I did something wrong when testing it myself yesterday. |
|
My mistake, I remembered wrong when cache gets cleared, and when I did run with cache=false and then with cache=true, the cache was still having the old version. After clearing the cache, this PR works. So this PR works only after the fit object in the cache has been created with this PR, while my PR works also if the cache has been created with earlier version. |
Submission Checklist
Summary
Fixes #1012
This an alternative to #1176 that takes a different approach to giving the user an informative message when quarto fails to find the csv files.
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):
Jonah Gabry
By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the following licenses: