[ARVADOS] updated: 1.1.2-268-g47cb450
Git user
git at public.curoverse.com
Thu Feb 8 06:47:12 EST 2018
Summary of changes:
sdk/R/NAMESPACE | 8 ++++----
sdk/R/R/Arvados.R | 24 ++++++++++++++++--------
sdk/R/R/ArvadosFile.R | 25 +++++++++++++++----------
sdk/R/R/Collection.R | 16 ++++++++++++----
sdk/R/R/CollectionTree.R | 5 -----
sdk/R/R/HttpParser.R | 2 --
sdk/R/R/Subcollection.R | 20 +++++++++++++-------
sdk/R/man/Arvados.Rd | 8 +++++---
sdk/R/man/ArvadosFile.Rd | 7 +++----
sdk/R/man/Collection.Rd | 4 +++-
sdk/R/man/CollectionTree.Rd | 17 -----------------
sdk/R/man/HttpParser.Rd | 14 --------------
sdk/R/man/print.Arvados.Rd | 16 ++++++++++++++++
sdk/R/man/print.ArvadosFile.Rd | 16 ++++++++++++++++
sdk/R/man/print.Collection.Rd | 16 ++++++++++++++++
sdk/R/man/print.Subcollection.Rd | 16 ++++++++++++++++
16 files changed, 135 insertions(+), 79 deletions(-)
delete mode 100644 sdk/R/man/CollectionTree.Rd
delete mode 100644 sdk/R/man/HttpParser.Rd
create mode 100644 sdk/R/man/print.Arvados.Rd
create mode 100644 sdk/R/man/print.ArvadosFile.Rd
create mode 100644 sdk/R/man/print.Collection.Rd
create mode 100644 sdk/R/man/print.Subcollection.Rd
via 47cb4506cc97c701639038a12f08374e8f06c41b (commit)
from 1e00053e7bc962a827ae960c1953ac9bd63d503b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 47cb4506cc97c701639038a12f08374e8f06c41b
Author: Fuad Muhic <fmuhic at capeannenterprises.com>
Date: Thu Feb 8 12:45:34 2018 +0100
Added documentation for print classes
Arvados-DCO-1.1-Signed-off-by: Fuad Muhic <fmuhic at capeannenterprises.com>
diff --git a/sdk/R/NAMESPACE b/sdk/R/NAMESPACE
index d4c143c..f2cae86 100644
--- a/sdk/R/NAMESPACE
+++ b/sdk/R/NAMESPACE
@@ -1,10 +1,10 @@
# Generated by roxygen2: do not edit by hand
+S3method(print,Arvados)
+S3method(print,ArvadosFile)
+S3method(print,Collection)
+S3method(print,Subcollection)
export(Arvados)
export(ArvadosFile)
export(Collection)
export(Subcollection)
-export(print.Arvados)
-export(print.ArvadosFile)
-export(print.Collection)
-export(print.Subcollection)
diff --git a/sdk/R/R/Arvados.R b/sdk/R/R/Arvados.R
index d9bd091..8b0e92b 100644
--- a/sdk/R/R/Arvados.R
+++ b/sdk/R/R/Arvados.R
@@ -7,7 +7,7 @@ source("./R/HttpParser.R")
#' Arvados class gives users ability to manipulate collections and projects.
#'
#' @section Usage:
-#' \preformatted{arv = Arvados$new(authToken, hostName, numRetries = 0)}
+#' \preformatted{arv = Arvados$new(authToken = NULL, hostName = NULL, numRetries = 0)}
#'
#' @section Arguments:
#' \describe{
@@ -48,9 +48,11 @@ source("./R/HttpParser.R")
#'
#' deletedCollection <- arv$deleteCollection("uuid")
#'
-#' updatedCollection <- arv$updateCollection("uuid", list(name = "New name", description = "New description"))
+#' updatedCollection <- arv$updateCollection("uuid", list(name = "New name",
+#' description = "New description"))
#'
-#' createdCollection <- arv$createCollection(list(name = "Example", description = "This is a test collection"))
+#' createdCollection <- arv$createCollection(list(name = "Example",
+#' description = "This is a test collection"))
#' }
NULL
@@ -219,10 +221,16 @@ Arvados <- R6::R6Class(
cloneable = FALSE
)
-#' @export print.Arvados
-print.Arvados = function(arvados)
+#' print.Arvados
+#'
+#' Custom print function for Arvados class
+#'
+#' @param x Instance of Arvados class
+#' @param ... Optional arguments.
+#' @export
+print.Arvados = function(x, ...)
{
- cat(paste0("Type: ", "\"", "Arvados", "\""), sep = "\n")
- cat(paste0("Host: ", "\"", arvados$getHostName(), "\""), sep = "\n")
- cat(paste0("Token: ", "\"", arvados$getToken(), "\""), sep = "\n")
+ cat(paste0("Type: ", "\"", "Arvados", "\""), sep = "\n")
+ cat(paste0("Host: ", "\"", x$getHostName(), "\""), sep = "\n")
+ cat(paste0("Token: ", "\"", x$getToken(), "\""), sep = "\n")
}
diff --git a/sdk/R/R/ArvadosFile.R b/sdk/R/R/ArvadosFile.R
index 53321ef..e28ba96 100644
--- a/sdk/R/R/ArvadosFile.R
+++ b/sdk/R/R/ArvadosFile.R
@@ -14,12 +14,12 @@ source("./R/util.R")
#'
#' @section Methods:
#' \describe{
-#' \item{getName()}{Returns name of the file}
+#' \item{getName()}{Returns name of the file.}
#' \item{getRelativePath()}{Returns file path relative to the root.}
#' \item{read(contentType = "raw", offset = 0, length = 0)}{Read file content.}
#' \item{write(content, contentType = "text/html")}{Write to file (override current content of the file).}
#' \item{connection(rw)}{Get connection opened in "read" or "write" mode.}
-#' \item{flush()}{Write content of the connecitons buffer to a file (override current content of the file).}
+#' \item{flush()}{Write connections content to a file (override current content of the file).}
#' \item{remove(name)}{Removes ArvadosFile or Subcollection specified by name from the subcollection.}
#' \item{getSizeInBytes()}{Returns file size in bytes.}
#' \item{move(newLocation)}{Moves file to a new location inside collection.}
@@ -33,8 +33,7 @@ source("./R/util.R")
#' myFile$write("This is new file content")
#' fileContent <- myFile$read()
#' fileContent <- myFile$read("text")
-#' fileContent <- myFile$read("raw", offset = 1024, length = 512)
-#'
+#' fileContent <- myFile$read("raw", offset = 8, length = 4)
#'
#' #Write a table:
#' arvConnection <- myFile$connection("w")
@@ -246,20 +245,26 @@ ArvadosFile <- R6::R6Class(
cloneable = FALSE
)
-#' @export print.ArvadosFile
-print.ArvadosFile = function(arvadosFile)
+#' print.ArvadosFile
+#'
+#' Custom print function for ArvadosFile class
+#'
+#' @param x Instance of ArvadosFile class
+#' @param ... Optional arguments.
+#' @export
+print.ArvadosFile = function(x, ...)
{
collection <- NULL
- relativePath <- arvadosFile$getRelativePath()
+ relativePath <- x$getRelativePath()
- if(!is.null(arvadosFile$getCollection()))
+ if(!is.null(x$getCollection()))
{
- collection <- arvadosFile$getCollection()$uuid
+ collection <- x$getCollection()$uuid
relativePath <- paste0("/", relativePath)
}
cat(paste0("Type: ", "\"", "ArvadosFile", "\""), sep = "\n")
- cat(paste0("Name: ", "\"", arvadosFile$getName(), "\""), sep = "\n")
+ cat(paste0("Name: ", "\"", x$getName(), "\""), sep = "\n")
cat(paste0("Relative path: ", "\"", relativePath, "\""), sep = "\n")
cat(paste0("Collection: ", "\"", collection, "\""), sep = "\n")
}
diff --git a/sdk/R/R/Collection.R b/sdk/R/R/Collection.R
index b788f9c..ed5b4f4 100644
--- a/sdk/R/R/Collection.R
+++ b/sdk/R/R/Collection.R
@@ -29,9 +29,11 @@ source("./R/util.R")
#' @name Collection
#' @examples
#' \dontrun{
+#' arv <- Arvados$new("your Arvados token", "example.arvadosapi.com")
#' collection <- Collection$new(arv, "uuid")
#'
-#' collection$add(existingArvadosFile, "cpp")
+#' newFile <- ArvadosFile$new("myFile")
+#' collection$add(newFile, "myFolder")
#'
#' createdFiles <- collection$create(c("main.cpp", lib.dll), "cpp/src/")
#'
@@ -212,9 +214,15 @@ Collection <- R6::R6Class(
cloneable = FALSE
)
-#' @export print.Collection
-print.Collection = function(collection)
+#' print.Collection
+#'
+#' Custom print function for Collection class
+#'
+#' @param x Instance of Collection class
+#' @param ... Optional arguments.
+#' @export
+print.Collection = function(x, ...)
{
cat(paste0("Type: ", "\"", "Arvados Collection", "\""), sep = "\n")
- cat(paste0("uuid: ", "\"", collection$uuid, "\""), sep = "\n")
+ cat(paste0("uuid: ", "\"", x$uuid, "\""), sep = "\n")
}
diff --git a/sdk/R/R/CollectionTree.R b/sdk/R/R/CollectionTree.R
index 4194be9..91e4ec8 100644
--- a/sdk/R/R/CollectionTree.R
+++ b/sdk/R/R/CollectionTree.R
@@ -2,11 +2,6 @@ source("./R/Subcollection.R")
source("./R/ArvadosFile.R")
source("./R/util.R")
-#' Arvados Collection Object
-#'
-#' Update description
-#'
-#' @examples arv = Collection$new(api, uuid)
CollectionTree <- R6::R6Class(
"CollectionTree",
public = list(
diff --git a/sdk/R/R/HttpParser.R b/sdk/R/R/HttpParser.R
index 8fe28b7..5df8287 100644
--- a/sdk/R/R/HttpParser.R
+++ b/sdk/R/R/HttpParser.R
@@ -1,5 +1,3 @@
-#' HttpParser
-#'
HttpParser <- R6::R6Class(
"HttrParser",
diff --git a/sdk/R/R/Subcollection.R b/sdk/R/R/Subcollection.R
index 179bbcd..863e3f7 100644
--- a/sdk/R/R/Subcollection.R
+++ b/sdk/R/R/Subcollection.R
@@ -302,22 +302,28 @@ Subcollection <- R6::R6Class(
cloneable = FALSE
)
-#' @export print.Subcollection
-print.Subcollection = function(subCollection)
+#' print.Subcollection
+#'
+#' Custom print function for Subcollection class
+#'
+#' @param x Instance of Subcollection class
+#' @param ... Optional arguments.
+#' @export
+print.Subcollection = function(x, ...)
{
collection <- NULL
- relativePath <- subCollection$getRelativePath()
+ relativePath <- x$getRelativePath()
- if(!is.null(subCollection$getCollection()))
+ if(!is.null(x$getCollection()))
{
- collection <- subCollection$getCollection()$uuid
+ collection <- x$getCollection()$uuid
- if(!subCollection$getName() == "")
+ if(!x$getName() == "")
relativePath <- paste0("/", relativePath)
}
cat(paste0("Type: ", "\"", "Arvados Subcollection", "\""), sep = "\n")
- cat(paste0("Name: ", "\"", subCollection$getName(), "\""), sep = "\n")
+ cat(paste0("Name: ", "\"", x$getName(), "\""), sep = "\n")
cat(paste0("Relative path: ", "\"", relativePath, "\""), sep = "\n")
cat(paste0("Collection: ", "\"", collection, "\""), sep = "\n")
}
diff --git a/sdk/R/man/Arvados.Rd b/sdk/R/man/Arvados.Rd
index 9173830..3c66437 100644
--- a/sdk/R/man/Arvados.Rd
+++ b/sdk/R/man/Arvados.Rd
@@ -8,7 +8,7 @@ Arvados class gives users ability to manipulate collections and projects.
}
\section{Usage}{
-\preformatted{arv = Arvados$new(authToken, hostName, numRetries = 0)}
+\preformatted{arv = Arvados$new(authToken = NULL, hostName = NULL, numRetries = 0)}
}
\section{Arguments}{
@@ -53,8 +53,10 @@ collectionList <- arv$listAllCollections(list(list("name", "like", "Test\%")))
deletedCollection <- arv$deleteCollection("uuid")
-updatedCollection <- arv$updateCollection("uuid", list(name = "New name", description = "New description"))
+updatedCollection <- arv$updateCollection("uuid", list(name = "New name",
+ description = "New description"))
-createdCollection <- arv$createCollection(list(name = "Example", description = "This is a test collection"))
+createdCollection <- arv$createCollection(list(name = "Example",
+ description = "This is a test collection"))
}
}
diff --git a/sdk/R/man/ArvadosFile.Rd b/sdk/R/man/ArvadosFile.Rd
index 41f68bc..b7840dc 100644
--- a/sdk/R/man/ArvadosFile.Rd
+++ b/sdk/R/man/ArvadosFile.Rd
@@ -21,12 +21,12 @@ ArvadosFile class represents a file inside Arvados collection.
\section{Methods}{
\describe{
- \item{getName()}{Returns name of the file}
+ \item{getName()}{Returns name of the file.}
\item{getRelativePath()}{Returns file path relative to the root.}
\item{read(contentType = "raw", offset = 0, length = 0)}{Read file content.}
\item{write(content, contentType = "text/html")}{Write to file (override current content of the file).}
\item{connection(rw)}{Get connection opened in "read" or "write" mode.}
- \item{flush()}{Write content of the connecitons buffer to a file (override current content of the file).}
+ \item{flush()}{Write connections content to a file (override current content of the file).}
\item{remove(name)}{Removes ArvadosFile or Subcollection specified by name from the subcollection.}
\item{getSizeInBytes()}{Returns file size in bytes.}
\item{move(newLocation)}{Moves file to a new location inside collection.}
@@ -40,8 +40,7 @@ myFile <- ArvadosFile$new("myFile")
myFile$write("This is new file content")
fileContent <- myFile$read()
fileContent <- myFile$read("text")
-fileContent <- myFile$read("raw", offset = 1024, length = 512)
-
+fileContent <- myFile$read("raw", offset = 8, length = 4)
#Write a table:
arvConnection <- myFile$connection("w")
diff --git a/sdk/R/man/Collection.Rd b/sdk/R/man/Collection.Rd
index 4e96b7c..8cf29a2 100644
--- a/sdk/R/man/Collection.Rd
+++ b/sdk/R/man/Collection.Rd
@@ -33,9 +33,11 @@ Collection class provides interface for working with Arvados collections.
\examples{
\dontrun{
+arv <- Arvados$new("your Arvados token", "example.arvadosapi.com")
collection <- Collection$new(arv, "uuid")
-collection$add(existingArvadosFile, "cpp")
+newFile <- ArvadosFile$new("myFile")
+collection$add(newFile, "myFolder")
createdFiles <- collection$create(c("main.cpp", lib.dll), "cpp/src/")
diff --git a/sdk/R/man/CollectionTree.Rd b/sdk/R/man/CollectionTree.Rd
deleted file mode 100644
index adeed46..0000000
--- a/sdk/R/man/CollectionTree.Rd
+++ /dev/null
@@ -1,17 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/CollectionTree.R
-\docType{data}
-\name{CollectionTree}
-\alias{CollectionTree}
-\title{Arvados Collection Object}
-\format{An object of class \code{R6ClassGenerator} of length 24.}
-\usage{
-CollectionTree
-}
-\description{
-Update description
-}
-\examples{
-arv = Collection$new(api, uuid)
-}
-\keyword{datasets}
diff --git a/sdk/R/man/HttpParser.Rd b/sdk/R/man/HttpParser.Rd
deleted file mode 100644
index 68d314f..0000000
--- a/sdk/R/man/HttpParser.Rd
+++ /dev/null
@@ -1,14 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/HttpParser.R
-\docType{data}
-\name{HttpParser}
-\alias{HttpParser}
-\title{HttpParser}
-\format{An object of class \code{R6ClassGenerator} of length 24.}
-\usage{
-HttpParser
-}
-\description{
-HttpParser
-}
-\keyword{datasets}
diff --git a/sdk/R/man/print.Arvados.Rd b/sdk/R/man/print.Arvados.Rd
new file mode 100644
index 0000000..0833d15
--- /dev/null
+++ b/sdk/R/man/print.Arvados.Rd
@@ -0,0 +1,16 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/Arvados.R
+\name{print.Arvados}
+\alias{print.Arvados}
+\title{print.Arvados}
+\usage{
+\method{print}{Arvados}(x, ...)
+}
+\arguments{
+\item{x}{Instance of Arvados class}
+
+\item{...}{Optional arguments.}
+}
+\description{
+Custom print function for Arvados class
+}
diff --git a/sdk/R/man/print.ArvadosFile.Rd b/sdk/R/man/print.ArvadosFile.Rd
new file mode 100644
index 0000000..566ec8b
--- /dev/null
+++ b/sdk/R/man/print.ArvadosFile.Rd
@@ -0,0 +1,16 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/ArvadosFile.R
+\name{print.ArvadosFile}
+\alias{print.ArvadosFile}
+\title{print.ArvadosFile}
+\usage{
+\method{print}{ArvadosFile}(x, ...)
+}
+\arguments{
+\item{x}{Instance of ArvadosFile class}
+
+\item{...}{Optional arguments.}
+}
+\description{
+Custom print function for ArvadosFile class
+}
diff --git a/sdk/R/man/print.Collection.Rd b/sdk/R/man/print.Collection.Rd
new file mode 100644
index 0000000..8852383
--- /dev/null
+++ b/sdk/R/man/print.Collection.Rd
@@ -0,0 +1,16 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/Collection.R
+\name{print.Collection}
+\alias{print.Collection}
+\title{print.Collection}
+\usage{
+\method{print}{Collection}(x, ...)
+}
+\arguments{
+\item{x}{Instance of Collection class}
+
+\item{...}{Optional arguments.}
+}
+\description{
+Custom print function for Collection class
+}
diff --git a/sdk/R/man/print.Subcollection.Rd b/sdk/R/man/print.Subcollection.Rd
new file mode 100644
index 0000000..621350f
--- /dev/null
+++ b/sdk/R/man/print.Subcollection.Rd
@@ -0,0 +1,16 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/Subcollection.R
+\name{print.Subcollection}
+\alias{print.Subcollection}
+\title{print.Subcollection}
+\usage{
+\method{print}{Subcollection}(x, ...)
+}
+\arguments{
+\item{x}{Instance of Subcollection class}
+
+\item{...}{Optional arguments.}
+}
+\description{
+Custom print function for Subcollection class
+}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list