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
efforts for using the job id for various utility functions #328
Conversation
this PR makes it possible to do check("https://cida.usgs.gov:443/gdp/process/RetrieveResultServlet?id=5decb04b-056d-4c46-a2c0-13908711a3a7")
successful("https://cida.usgs.gov:443/gdp/process/RetrieveResultServlet?id=5decb04b-056d-4c46-a2c0-13908711a3a7")
error("https://cida.usgs.gov:443/gdp/process/RetrieveResultServlet?id=5decb04b-056d-4c46-a2c0-13908711a3a7")
download("https://cida.usgs.gov:443/gdp/process/RetrieveResultServlet?id=5decb04b-056d-4c46-a2c0-13908711a3a7")
result("https://cida.usgs.gov:443/gdp/process/RetrieveResultServlet?id=5decb04b-056d-4c46-a2c0-13908711a3a7") and the like. one thing it doesn't do is let you pick up a job ID and start a wait until finished checker on it. But that wasn't part of this task as far as I understood it. |
Changes Unknown when pulling 04cc6da on jread-usgs:master into ** on USGS-R:master**. |
oops 😁 |
Just added the job <- geoknife(stencil = c(-89,42), fabric = 'prism', wait=FALSE)
wait(id(job)) %>% result()
DateTime bufferedPoint variable statistic
1 1895-01-01 41.1600 ppt MEAN
2 1895-02-01 13.9825 ppt MEAN
... where id(job) is the process URL I refer to above ☝️ |
Changes Unknown when pulling e99cd31 on jread-usgs:master into ** on USGS-R:master**. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
R/download-geojob.R
Outdated
#'@param destination a file destination. If missing, a temp directory will be used | ||
#'@param ... additional arguments passed to \code{\link[httr]{write_disk}}, such as overwrite = TRUE | ||
#'@return the file handle | ||
#'@return the destination of the downloaded file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since the file is downloaded, this should be location rather that destination, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right. Changing.
|
||
#' @rdname wait | ||
#' @aliases wait | ||
setMethod(f = "wait",signature(.Object = "character", sleep.time = "missing"), definition = function(.Object, sleep.time){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if there is a way to do this without needed 4 signatures? If we add any more arguments the number of signatures keeps increasing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only need to define types for signatures that we need to dispatch based on. Alternatively, I could use "ANY" for the sleep.time signature (or leave that off) and handle if(missing(sleep.time))
within the function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See https://github.com/USGS-R/geoknife/blob/master/R/successful.R#L37 for example - only dispatching based on the first arg, so I can leave off signatures for the second arg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... but now I see that the pattern I linked to isn't actually using that default because of the way s4 works (which is why I used "missing" here)...oh boy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will clean up what I just discovered @jiwalker-usgs ☝️
Changes Unknown when pulling b497cf3 on jread-usgs:master into ** on USGS-R:master**. |
Fixes #236