Skip to content

Commit 2cbb72e

Browse files
committed
more checkmate
1 parent e6377b2 commit 2cbb72e

5 files changed

Lines changed: 4 additions & 12 deletions

File tree

R/parallelExport.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#' @export
2929
parallelExport = function(..., objnames, master=TRUE, level=NA_character_, show.info=NA) {
3030
args = list(...)
31-
checkListElementClass(args, "character")
31+
assertList(args, types = "character")
3232
if (!missing(objnames)) {
3333
assertCharacter(objnames, any.missing = FALSE)
3434
objnames = c(as.character(args), objnames)

R/parallelLibrary.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#' @export
2929
parallelLibrary = function(..., packages, master=TRUE, level=as.character(NA), show.info=NA) {
3030
args = list(...)
31-
checkListElementClass(args, "character")
31+
assertList(args, types = "character")
3232
if (!missing(packages)) {
3333
assertCharacter(packages, any.missing = FALSE)
3434
packages = c(as.character(args), packages)

R/parallelSource.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#' @export
2929
parallelSource = function(..., files, master=TRUE, level=as.character(NA), show.info=NA) {
3030
args = list(...)
31-
checkListElementClass(args, "character")
31+
assertList(args, types = "character")
3232
if (!missing(files)) {
3333
assertCharacter(files, any.missing = FALSE)
3434
files = c(as.character(args), files)

R/parallelStart.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ parallelStart = function(mode, cpus, socket.hosts, bj.resources=list(), logging,
101101
# multicore not supported on windows
102102
if (mode == MODE_MULTICORE && .Platform$OS.type == "windows")
103103
stop("Multicore mode not supported on windows!")
104-
# check that storagedir is indeed a valid dir
105-
checkDir("Storage", storagedir)
104+
assertDirectory(storagedir, access = "w")
106105

107106
# store options for session, we already need them for helper funs below
108107
options(parallelMap.mode = mode)

R/utils.R

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
# check dir exists and is indeed a dir
2-
checkDir = function(dirname, dir) {
3-
if (!file.exists(dir))
4-
stopf("%s directory does not exists: %s", dirname, dir)
5-
if (!isDirectory(dir))
6-
stopf("% directory is not a directory: %s", dirname, dir)
7-
}
81

92
isShowInfoEnabled = function() {
103
getPMOptShowInfo()

0 commit comments

Comments
 (0)