Repository navigation
Say why a fit can't read its CSV files after the temp directory is gone - #1316
Merged
Merged
Conversation
jgabry
commented
Oct 7, 2026
| files <- self$output_files(include_failed = FALSE) | ||
| output_dir <- self$runset$args$output_dir | ||
| if (!all(file.exists(files)) && | ||
| isTRUE(self$runset$args$using_tempdir) && |
Member
Author
There was a problem hiding this comment.
as_cmdstan_fit() has no runset, so using_tempdir is NULL so using isTRUE
jgabry
commented
Oct 7, 2026
| output_dir <- self$runset$args$output_dir | ||
| if (!all(file.exists(files)) && | ||
| isTRUE(self$runset$args$using_tempdir) && | ||
| all(dirname(files) == output_dir)) { |
Member
Author
There was a problem hiding this comment.
$save_output_files() moves the files out of the temp directory but leaves using_tempdir as it was (for reasons), so we need to check that the files still sit in the run's recorded output_dir
2 tasks done
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v1.0 #1316 +/- ##
=======================================
Coverage ? 93.98%
=======================================
Files ? 19
Lines ? 7363
Branches ? 0
=======================================
Hits ? 6920
Misses ? 443
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
On WSL the output directory is a //wsl$ network path, and R's Windows dirname() spells the leading // as \\ to preserve the share, so the comparison in csv_files_() was never true there.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 #1012. Replaces #1178 (and #1176 before it) with a smaller change.
A fit restored from a cached Quarto or R Markdown chunk, or loaded with
readRDS()in a later session, points at CSV files in the old session's temporary directory, and the first$draws()fails insideread_cmdstan_csv()with checkmate's "File does not exist". A new privatecsv_files_()method onCmdStanFitthrows an error that says what happened and what to do (passoutput_diror save with$save_object()).$save_output_files()moves the files out of the temp directory but leavesusing_tempdiras it was (for reasons), so we also check that the files are still in the run's recordedoutput_dir(thedirname()comparison in the code).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: