Skip to content

Commit

Permalink
Updates towards v1 rel
Browse files Browse the repository at this point in the history
  • Loading branch information
kcratie committed Feb 12, 2016
1 parent e07a16a commit 44aa3e0
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 62 deletions.
16 changes: 9 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
Package: GrapleR
Title: Graple Webservice Interface for R
Version: 15.6.0.8
Package: GRAPLEr
Title: Distributed computing made easy for lake ecology modeling
Version: 1.0.0
Authors@R: c(person("Ken", "S", role = c("aut", "cre"),
email = "[email protected]"),
person("Renato", "F", role = "cph"),
person("Saumitra", "A", role = "ctb",
email = "[email protected]"))
Description: What the package does (one paragraph)
email = "[email protected]"))
Description: GRAPLEr brings the power of distributing computing to the fingertips of lake ecology modelers. It is an R Package for connecting to the GRAPLE Web Service (GWS) and running GRAPLE jobs. Experiments consisting of thousands of simulations can be evaluated in a fraction of the time by submitting batches of GLM (General Lake Model) simulations to a distributed computing system, directly from your R/RStudio environment.
Depends:
R (>= 3.1.3)
Imports:
bitops,
ncdf,
RCurl,
glmtools
GLMr,
glmtools,
License: GPL-3
URL: https://github.com/Graple/grapler
URL: http://graple.github.io/
LazyData: true
RoxygenNote: 5.0.1
40 changes: 22 additions & 18 deletions R/GrapleR.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

.onAttach <- function(libname, pkgname) {
packageStartupMessage("This information is preliminary or provisional and is subject to revision. It is being provided to meet the need for timely best science.")
packageStartupMessage("GRAPLEr has been developed with support from a supplement the the PRAGMA award (NSF OCI-1234983). For more information, please visit graple.org")
}

#' @title Get the Graple Service Status
#' @description
#' This function allows you to check the staus of the GrapeR service.
#' @param submissionURL URL:Port of the GrapeR service
#' This function allows you to check the staus of the GRAPLEr web service.
#' @param submissionURL URL:Port of the GRAPLEr web service
#' @return a string describing service status
#' @keywords Graple ServiceStatus
#' @export
Expand All @@ -23,15 +23,15 @@ GrapleCheckService<-function(submissionURL)

#' @title Sends the experiment (multiple simulations) to be run on GrapleR
#' This function allows you to run graple with an optional post-process filtering of results
#' @param submissionURL URL:Port of the GrapleR service
#' @param submissionURL URL:Port of the GRAPLEr web service
#' @param ExperimentDir the experiment root folder
#' @param FilterName the name of the post-processing filter script
#' @keywords Graple RunExperiment
#' @export
#' @examples
#' \dontrun{
#' graplerURL<-"http://128.227.150.20:80"
#' expRootDir<-"./Workspace/SimRoot"
#' graplerURL<-"http://graple-service.cloudapp.net"
#' expRootDir<-"./Workspace/ExpRoot"
#' filterName<-"Filter1.R"
#' GrapleRunExperiment(graplerURL, expRootDir, filterName)
#' }
Expand Down Expand Up @@ -59,16 +59,16 @@ GrapleRunExperiment<-function(submissionURL, ExperimentDir, FilterName)

#' @title Check the Graple Experiment Status
#' @description
#' This function allows you to check the staus of the GrapleR service.
#' @param submissionURL URL:Port of the GrapleR service
#' This function allows you to check the staus of the GRAPLEr web service.
#' @param submissionURL URL:Port of the GRAPLEr web service
#' @param experimentId Experiment ID returned from GrapleRunExperiment
#' or GrapleRunExperimentSweep
#' @return a string describing experiment status
#' @keywords Graple CheckExperimentCompletion
#' @export
#' @examples
#' \dontrun{
#' graplerURL<-"http://128.227.150.20:80"
#' graplerURL<-"http://graple-service.cloudapp.net"
#' expId<-"7YWMJYAYAR7Y3TNTAKC5801KMN7JHQW8NYBDMKUR"
#' GrapleCheckExperimentCompletion(graplerURL, expId)
#' }
Expand All @@ -83,20 +83,21 @@ GrapleCheckExperimentCompletion <- function(submissionURL, experimentId)
#' @description
#' This function allows you to retrieve the complete results
#' of an experiment.
#' @param submissionURL URL:Port of the GrapleR service
#' @param submissionURL URL:Port of the GRAPLEr web service
#' @param experimentId Experiment ID returned from GrapleRunExperiment
#' or GrapleRunExperimentSweep
#' @return a string describing the fully qualified result file name
#' @keywords Graple GetExperimentResults
#' @export
#' @examples
#' \dontrun{
#' graplerURL<-"http://128.227.150.20:80"
#' graplerURL<-"http://graple-service.cloudapp.net"
#' expId<-"7YWMJYAYAR7Y3TNTAKC5801KMN7JHQW8NYBDMKUR"
#' GrapleGetExperimentResults(graplerURL, expId)
#' }
GrapleGetExperimentResults <- function(submissionURL, experimentId)
{
td<-getwd()
qurl <- paste(submissionURL, "GrapleRunResults", experimentId, sep="/")
status<- getURL(qurl)

Expand All @@ -111,14 +112,15 @@ GrapleGetExperimentResults <- function(submissionURL, experimentId)
file.remove("results.tar.gz")
files <- list.files(".")
lapply(files, function(x){untar(x); file.remove(x)})
setwd(td)
return(resultfile)
}

#' @title Creates an experiment based on sweep parameters
#' @description
#' This function allows you to run an experiment using a single simulation.
#' The sweep parameters are used to generate the other sims.
#' @param submissionURL URL:Port of the GrapeR service
#' @param submissionURL URL:Port of the GRAPLEr web service
#' @param simDir the simulation folder containing the driver file
#' @param driverFileName the driver file name
#' @param parameterName the column name from the driver file to be swept
Expand All @@ -131,7 +133,7 @@ GrapleGetExperimentResults <- function(submissionURL, experimentId)
#' @export
#' @examples
#' \dontrun{
#' simDir="C:/Workspace/SimRoot/Sim0"
#' simDir="./Workspace/ExpRoot/Exp0"
#' driverFileName="met_hourly.csv"
#' parameterName="AirTemp"
#' startValue=-2
Expand Down Expand Up @@ -188,15 +190,15 @@ GrapleRunExperimentSweep <- function(submissionURL, simDir, driverFileName, para
#' Parametername1, add, uniform, -1, 1
#' Paramtername2, sub, binomial, 10, 0.5

#' @param submissionURL URL:Port of the GrapleR service
#' @param submissionURL URL:Port of the GRAPLEr web service
#' @param simDir the simulation folder containing the driver file
#' @param FilterName the name of post-process filter
#' @return the experiment ID
#' @keywords Graple RunExperimentJob
#' @export
#' @examples
#' \dontrun{
#' simDir="C:/Workspace/SimRoot"
#' simDir="./Workspace/ExpRoot/Exp0"
#' FilterName="Filter1.R"
#' expId<-GrapleRunExperimentJob(graplerURL, simDir, FilterName)
#' }
Expand All @@ -220,7 +222,7 @@ GrapleRunExperimentJob <- function(submissionURL, simDir, FilterName)
if (file.exists(tarfile)) file.remove(tarfile)
unlink("../tempGRAPLE", recursive = TRUE)
print(status)
expid <- substr(status[1], start=56, stop=95)
expid <- substr(status[1], start=57, stop=96)
setwd(td)
return (expid)
}
Expand All @@ -229,20 +231,21 @@ GrapleRunExperimentJob <- function(submissionURL, simDir, FilterName)
#' @description
#' This function allows you to retrieve the complete results
#' of an sweep job style experiment.
#' @param submissionURL URL:Port of the GrapeR service
#' @param submissionURL URL:Port of the GRAPLEr web service
#' @param experimentId Experiment ID returned from GrapleRunExperiment
#' or GrapleRunExperimentSweep
#' @return a string describing the fully qualified result file name
#' @keywords Graple GetExperimentJobResults
#' @export
#' @examples
#' \dontrun{
#' graplerURL<-"http://128.227.150.20:80"
#' graplerURL<-"http://graple-service.cloudapp.net"
#' expId<-"7YWMJYAYAR7Y3TNTAKC5801KMN7JHQW8NYBDMKUR"
#' GrapleGetExperimentJobResults(graplerURL, expId)
#' }
GrapleGetExperimentJobResults <- function(submissionURL, experimentId)
{
td<-getwd()
qurl <- paste(submissionURL, "GrapleRunResultsMetSample", experimentId, sep="/")
status<- getURL(qurl)

Expand All @@ -257,5 +260,6 @@ GrapleGetExperimentJobResults <- function(submissionURL, experimentId)
file.remove("results.tar.gz")
files <- list.files(".", pattern = "\\.bz2\\.tar$")
lapply(files, function(x){untar(x); file.remove(x)})
setwd(td)
return(resultfile)
}
6 changes: 3 additions & 3 deletions man/GrapleCheckExperimentCompletion.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/GrapleCheckService.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/GrapleGetExperimentJobResults.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/GrapleGetExperimentResults.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/GrapleRunExperiment.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/GrapleRunExperimentJob.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/GrapleRunExperimentSweep.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 44aa3e0

Please sign in to comment.