-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Bug with saving model object to a network drive with UNC path #1026
Comments
Right now, This could be implemented by updating the regex at cmdstanr/R/utils.R from its current value:
to the following:
For example, if we updated
|
For #1026: update `repair_path()` to work with network paths, add test.
Closing now that #1038 is merged. Thanks for fixing this! |
Thank Jonah! I appreciate you taking the time to review this and accept the PR. |
It's always great to get contributions like this! Especially since at the moment we're a bit short on R developers. |
Describe the bug
I'm working in a fairly common situation where I have to use a Windows machine and store data on a network drive accessed by UNC paths (e.g. using paths such as
"\\westat.com\projects\my-project-folder\data.csv"
).I'm able to call
model_fit$save_output_files()
to save my CSV files of MCMC draws to the network folder. But when I try to save the model object (classCmdStanMCMC
) usingmodel_fit$save_object()
, I get an error message saying that the CSV files don't exist.I suspect that cmdstanr/cmdstan are having trouble with the two slashes at the beginning of the filepath.
Likely related to #1 (comment).
To Reproduce
Create a fitted model object with the usual example:
Save the CSV files to a network drive:
These CSV files do save successfully, all though it's a bit suspicious that the beginnings of the filepaths shown here only contain one slash.
Then try to save the fitted model object to the network drive:
I suspect there's an issue to do with the double slashes at the beginning of the filepath. See for example the following R output:
Expected behavior
I expected the model object to save without issue, since the CSV files were successfully copied.
Operating system
Windows 10 Enterprise
CmdStanR version number
Your CmdStanR version number (e.g. from
packageVersion("cmdstanr")
).Additional context
I think the issue has to do with the internal cmdstanr utility functions
repair_path()
andabsolute_path()
:cmdstanr/R/utils.R
Lines 125 to 136 in f2e152b
The text was updated successfully, but these errors were encountered: