Skip to content

Commit

Permalink
Renamed addPackage to installPackage
Browse files Browse the repository at this point in the history
  • Loading branch information
katieb1 committed Nov 30, 2023
1 parent 8f829d3 commit 95630f6
Show file tree
Hide file tree
Showing 78 changed files with 182 additions and 182 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Suggests:
SystemRequirements: SyncroSim (>=2.3.10)
Collate:
'AAAClassDefinitions.R'
'addPackage.R'
'installPackage.R'
'addRow.R'
'addon.R'
'autogentags.R'
Expand Down
4 changes: 2 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export(Session)
export(SsimLibrary)
export(addBreakpoint)
export(addModule)
export(addPackage)
export(addPackageFile)
export(installPackage)
export(installPackageFile)
export(addRow)
export(addon)
export(autogentags)
Expand Down
2 changes: 1 addition & 1 deletion R/addon.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ NULL
#' @examples
#' \donttest{
#' # Install the base package "stsim"
#' addPackage("stsim")
#' installPackage("stsim")
#'
#' # Set the file path and name of the new SsimLibrary
#' myLibraryName <- file.path(tempdir(),"testlib")
Expand Down
6 changes: 3 additions & 3 deletions R/breakpoint.R
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ getBPNameLongForm <- function(breakpointType) {
#' }
#'
#' # Install helloworldSpatial package
#' addPackage("helloworldSpatial")
#' installPackage("helloworldSpatial")
#'
#' # Set SsimLibrary name
#' myLibraryName <- file.path(tempdir(),"testlib")
Expand Down Expand Up @@ -290,7 +290,7 @@ setMethod("addBreakpoint", signature(x = "Scenario"), function(x, transformerNam
#' }
#'
#' # Install helloworldSpatial package
#' addPackage("helloworldSpatial")
#' installPackage("helloworldSpatial")
#'
#' # Set SsimLibrary name
#' myLibraryName <- file.path(tempdir(),"testlib")
Expand Down Expand Up @@ -369,7 +369,7 @@ setMethod("deleteBreakpoint", signature(x = "Scenario"), function(x, transformer
#' }
#'
#' # Install helloworldSpatial package
#' addPackage("helloworldSpatial")
#' installPackage("helloworldSpatial")
#'
#' # Set SsimLibrary name
#' myLibraryName <- file.path(tempdir(),"testlib")
Expand Down
2 changes: 1 addition & 1 deletion R/command.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ NULL
#' @examples
#' \dontrun{
#' # Install "stsim" if not already installed
#' addPackage("stsim")
#' installPackage("stsim")
#'
#' # Set the file path and name of the new SsimLibrary
#' myLibraryName <- file.path(tempdir(),"testlib.ssim")
Expand Down
2 changes: 1 addition & 1 deletion R/datasheet.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ NULL
#' @examples
#' \dontrun{
#' # Install helloworldSpatial package from package server
#' addPackage("helloworldSpatial")
#' installPackage("helloworldSpatial")
#'
#' # Set the file path and name of the new SsimLibrary
#' myLibraryName <- file.path(tempdir(),"testlib_datasheet")
Expand Down
4 changes: 2 additions & 2 deletions R/datasheetRaster.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ NULL
#' @examples
#' \dontrun{
#' # Install the helloworldSpatial package from the server
#' addPackage("helloworldSpatial")
#' installPackage("helloworldSpatial")
#'
#' # Specify file path and name of new SsimLibrary
#' myLibraryName <- file.path(tempdir(), "testlib_datasheetRaster")
Expand Down Expand Up @@ -112,7 +112,7 @@ NULL
#'
#' # Filter for only rasters that fit specific criteria
#' # Load the ST-Sim spatial example library
#' addPackage("stsim")
#' installPackage("stsim")
#'
#' # Set the file path and name of the new SsimLibrary
#' myLibraryName <- file.path(tempdir(),"testlib_stsim_datasheet")
Expand Down
4 changes: 2 additions & 2 deletions R/datasheetSpatRaster.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ NULL
#' @examples
#' \dontrun{
#' # Install the helloworldSpatial package from the server
#' addPackage("helloworldSpatial")
#' installPackage("helloworldSpatial")
#'
#' # Specify file path and name of new SsimLibrary
#' myLibraryName <- file.path(tempdir(), "testlib_datasheetSpatRaster")
Expand Down Expand Up @@ -107,7 +107,7 @@ NULL
#'
#' # Filter for only rasters that fit specific criteria
#' # Load the ST-Sim spatial example library
#' addPackage("stsim")
#' installPackage("stsim")
#'
#' # Set the file path and name of the new SsimLibrary
#' myLibraryName <- file.path(tempdir(),"testlib_stsim_datasheet")
Expand Down
16 changes: 8 additions & 8 deletions R/deprecated.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Add module
#'
#' `r lifecycle::badge("deprecated")`
#' Please use \code{\link{addPackage}} instead.
#' Please use \code{\link{installPackage}} instead.
#'
#' @param filename character string or vector of these. The path to an .ssimpkg
#' file on disk, or a vector of filepaths.
Expand All @@ -11,24 +11,24 @@
#'
#' @export
addModule <- function(filename, session = NULL) {
lifecycle::deprecate_warn("1.2.11", "addModule()", "addPackage()")
addPackage(filename, session)
lifecycle::deprecate_warn("1.2.11", "addModule()", "installPackage()")
installPackage(filename, session)
}

#' Adds a package to SyncroSim
#'
#' `r lifecycle::badge("deprecated")`
#' Please use \code{\link{addPackage}} instead.
#' Please use \code{\link{installPackage}} instead.
#'
#' @param filename character string. The path to a SyncroSim package file
#' @param session \code{\link{Session}} object
#'
#' @keywords internal
#'
#' @export
addPackageFile <- function(filename, session = NULL) {
lifecycle::deprecate_warn("1.2.11", "addPackageFile()", "addPackage()")
addPackage(filename, session)
installPackageFile <- function(filename, session = NULL) {
lifecycle::deprecate_warn("1.2.11", "installPackageFile()", "installPackage()")
installPackage(filename, session)
}

#' Installed base packages
Expand Down Expand Up @@ -219,4 +219,4 @@ envStepSimulation <- function() {
envEndSimulation <- function() {
lifecycle::deprecate_warn("1.2.11", "envEndSimulation()", "progressBar()")
progressBar(type = "end")
}
}
2 changes: 1 addition & 1 deletion R/disableAddon.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ NULL
#' @examples
#' \donttest{
#' # Install "stsim" SyncroSim package
#' addPackage("stsim")
#' installPackage("stsim")
#'
#' # Specify file path and name of new SsimLibrary
#' myLibraryName <- file.path(tempdir(), "testlib")
Expand Down
2 changes: 1 addition & 1 deletion R/enableAddon.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ NULL
#' @examples
#' \donttest{
#' # Install "stsim" SyncroSim package
#' addPackage("stsim")
#' installPackage("stsim")
#'
#' # Specify file path and name of new SsimLibrary
#' myLibraryName <- file.path(tempdir(), "testlib")
Expand Down
26 changes: 13 additions & 13 deletions R/addPackage.R → R/installPackage.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ NULL
#' This function installs a package to the SyncroSim \code{\link{Session}}.
#' If only the package name is provided as input, the function queries the
#' SyncroSim package server for the specified package. If a file path is
#' provided as input, the function adds a package to SyncroSim from a local
#' provided as input, the function installs a package to SyncroSim from a local
#' package file (ends in ".ssimpkg"). The list of SyncroSim packages can be
#' found \href{https://syncrosim.com/packages/}{here}.
#'
Expand All @@ -26,29 +26,29 @@ NULL
#' # Create a new SyncroSim Session
#' mySession <- session()
#'
#' # Add package from the package server
#' addPackage("stsim", session = mySession)
#' # Install package from the package server
#' installPackage("stsim", session = mySession)
#'
#' # Add package using a local file path
#' addPackage("c:/path/to/stsim.ssimpkg")
#' # Install package using a local file path
#' installPackage("c:/path/to/stsim.ssimpkg")
#' }
#'
#' @export
setGeneric("addPackage", function(name, session = NULL) standardGeneric("addPackage"))
setGeneric("installPackage", function(name, session = NULL) standardGeneric("installPackage"))

#' @rdname addPackage
setMethod("addPackage", signature(session = "character"), function(name, session) {
#' @rdname installPackage
setMethod("installPackage", signature(session = "character"), function(name, session) {
return(SyncroSimNotFound(session))
})

#' @rdname addPackage
setMethod("addPackage", signature(session = "missingOrNULL"), function(name, session) {
#' @rdname installPackage
setMethod("installPackage", signature(session = "missingOrNULL"), function(name, session) {
session <- .session()
return(addPackage(name, session))
return(installPackage(name, session))
})

#' @rdname addPackage
setMethod("addPackage", signature(session = "Session"), function(name, session) {
#' @rdname installPackage
setMethod("installPackage", signature(session = "Session"), function(name, session) {
success <- FALSE

if (is.null(name)) {
Expand Down
2 changes: 1 addition & 1 deletion R/package.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ NULL
#' package(myLibrary)
#'
#' # Check the templates available for an installed package
#' addPackage("helloworldSpatial")
#' installPackage("helloworldSpatial")
#' package(listTemplates = "helloworldSpatial")
#' }
#'
Expand Down
2 changes: 1 addition & 1 deletion R/parentId.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ NULL
#' @examples
#' \donttest{
#' # Install helloworldSpatial SyncroSim package
#' addPackage("helloworldSpatial")
#' installPackage("helloworldSpatial")
#'
#' # Set the file path and name of the new SsimLibrary
#' myLibraryName <- file.path(tempdir(),"testlib_parentId")
Expand Down
2 changes: 1 addition & 1 deletion R/run.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ NULL
#' @examples
#' \dontrun{
#' # Install helloworldSpatial package
#' addPackage("helloworldSpatial")
#' installPackage("helloworldSpatial")
#'
#' # Set the file path and name of the new SsimLibrary
#' myLibraryName <- file.path(tempdir(),"testlib")
Expand Down
2 changes: 1 addition & 1 deletion R/runLog.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ NULL
#' @examples
#' \dontrun{
#' # Install helloworldSpatial package
#' addPackage("helloworldSpatial")
#' installPackage("helloworldSpatial")
#'
#' # Set the file path and name of the new SsimLibrary
#' myLibraryName <- file.path(tempdir(),"testlib")
Expand Down
2 changes: 1 addition & 1 deletion R/saveDatasheet.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ NULL
#' @examples
#' \donttest{
#' # Install helloworldSpatial package
#' addPackage("helloworldSpatial")
#' installPackage("helloworldSpatial")
#'
#' # Set the file path and name of the new SsimLibrary
#' myLibraryName <- file.path(tempdir(),"testlib_saveDatasheet")
Expand Down
2 changes: 1 addition & 1 deletion R/sqlStatement.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ NULL
#'
#' # The SQL statement can then be used in the datasheet function
#' # Install helloworldSpatial package
#' addPackage("helloworldSpatial")
#' installPackage("helloworldSpatial")
#'
#' # Set the file path and name of the new SsimLibrary
#' myLibraryName <- file.path(tempdir(),"testlib_sqlStatement")
Expand Down
10 changes: 5 additions & 5 deletions R/ssimLibrary.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ setMethod(
packageOptions <- package(session, installed = "BASE")

if (nrow(packageOptions) == 0) {
stop("No base packages are installed. Use addPackage() to install a package.")
stop("No base packages are installed. Use installPackage() to install a package.")
}

if (identical(basename(name), name)) {
Expand Down Expand Up @@ -154,7 +154,7 @@ setMethod(
tt <- command(args, session)

if (grepl("Could not find package", tt[[1]])) {
stop(paste(tt[[1]], "Use addPackage() to install this package."))
stop(paste(tt[[1]], "Use installPackage() to install this package."))
}

if (grepl("The library has unapplied updates", tt[[1]])) {
Expand Down Expand Up @@ -309,8 +309,8 @@ setMethod(".ssimLibrary", signature(name = "SsimObject"), function(name, package
#' @examples
#' \donttest{
#' # Make sure packages are installed
#' addPackage("stsim")
#' addPackage("stsimsf")
#' installPackage("stsim")
#' installPackage("stsimsf")
#'
#' # Create or open a SsimLibrary using the default Session
#' myLibrary <- ssimLibrary(name = file.path(tempdir(), "mylib"))
Expand All @@ -330,7 +330,7 @@ setMethod(".ssimLibrary", signature(name = "SsimObject"), function(name, package
#' addon = "stsimsf")
#'
#' # Create SsimLibrary from template
#' addPackage("helloworldSpatial")
#' installPackage("helloworldSpatial")
#' mySession <- session()
#' myLibrary <- ssimLibrary(name = file.path(tempdir(), "mylib"),
#' session = mySession,
Expand Down
10 changes: 5 additions & 5 deletions docs/articles/a01_rsyncrosim_vignette_basic.html

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

6 changes: 3 additions & 3 deletions docs/articles/a02_rsyncrosim_vignette_uncertainty.html

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

6 changes: 3 additions & 3 deletions docs/articles/a03_rsyncrosim_vignette_pipelines.html

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

Loading

0 comments on commit 95630f6

Please sign in to comment.