dankelley / oceglider

R package for processing ocean glider data
https://dankelley.github.io/oceglider/
3 stars 1 forks source link

windows remote R-CMD-check fails #120

Closed dankelley closed 2 months ago

dankelley commented 2 months ago

A snippet is below. I thought windows accepted / in filenames but maybe I need to use https://rdrr.io/r/base/file.path.html ... although the docs for that say that it will use / by default. I dunno -- worth a try.

downloaded 15.5 MB
Quitting from lines 200-212 [unnamed-chunk-9] (sea_explorer.Rmd)
Error: Error: processing vignette 'sea_explorer.Rmd' failed with diagnostics:
Error in nc_open trying to open file C:\Users\RUNNER~1\AppData\Local\Temp\RtmpE1Nfjx/dfo-eva035-20190718_delayed.nc (return_on_error= FALSE )
--- failed re-building 'sea_explorer.Rmd'
--- re-building 'slocum_glider.Rmd' using rmarkdown
--- finished re-building 'slocum_glider.Rmd'
SUMMARY: processing the following file failed:
  'sea_explorer.Rmd'
dankelley commented 2 months ago

My first trial didn't work. Trial 2 pushed to GH, to start the R-CMD-check process.

dankelley commented 2 months ago

With trial 2, using

urlNC <- paste0(
    "https://cproof.uvic.ca/gliderdata/deployments/",
    "dfo-eva035/dfo-eva035-20190718/",
    "/L0-timeseries/dfo-eva035-20190718_delayed.nc"
)
fileNC <- file.path(tmpdir, sub(".*/", "", urlNC))
download.file(urlNC, fileNC)
G <- read.glider.netcdf(fileNC)

I get as follows.

Error in nc_open trying to open file C:\Users\RUNNER~1\AppData\Local\Temp\RtmpoH8aSJ/dfo-eva035-20190718_delayed.nc (return_on_error= FALSE )

I'm not sure what else to try. Should I try (how?) to detect that it's a windows machine, and just construct the path myself? Or maybe it never downloaded the file.

I note that the docs for file.path() say that it uses / instead of \ on windows. I was under the impression that this would be okay -- that the default would only be / if it would work.

The fact that this all works on mac and linux suggests that it's not some other blunder, apart from the / versus \.

I may fiddle some more, but I think I'm at an impasse.

This is not super-high priority, because I've done all the other cleanup I wanted to do, and got everything into a shape that could go to CRAN if the group decides on that.

I'm going to post a question on an R developers mailing list.

Maybe sometime when @richardsc is at Dal and has a windows machine, we could try a realtime test, to see if the file downloads, whether it's present, etc.

dankelley commented 2 months ago

Fixed, with near-instant help from @clayton33 :-)