Skip to content

Commit

Permalink
allow 'NULL' for entity arguments of avworkflow_run()
Browse files Browse the repository at this point in the history
- #65
  • Loading branch information
mtmorgan committed Oct 6, 2022
1 parent b4b09ff commit 476e977
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
12 changes: 7 additions & 5 deletions R/avworkflow.R
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,12 @@ avworkflow_localize <-
#' @param config a `avworkflow_configuration` object of the workflow that will
#' be run.
#'
#' @param entityName character(1) name of the set of samples to be used when
#' running the workflow.
#' @param entityName character(1) or NULL name of the set of samples
#' to be used when running the workflow. NULL indicates that no
#' sample set will be used.
#'
#' @param entityType character(1) type of root entity used for the workflow.
#' @param entityType character(1) or NULL type of root entity used for
#' the workflow. NULL means that no root entity will be used.
#'
#' @param deleteIntermediateOutputFiles logical(1) whether or not to delete
#' intermediate output files when the workflow completes.
Expand Down Expand Up @@ -401,8 +403,8 @@ avworkflow_run <-
{
stopifnot(
inherits(config, "avworkflow_configuration"),
.is_scalar_character(entityName),
.is_scalar_character(entityType),
.is_scalar_character_or_NULL(entityName),
.is_scalar_character_or_NULL(entityType),
.is_scalar_logical(deleteIntermediateOutputFiles),
.is_scalar_logical(useCallCache),
.is_scalar_logical(useReferenceDisks),
Expand Down
3 changes: 3 additions & 0 deletions R/utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
.is_scalar_character <- function(x, na.ok = FALSE, zchar = FALSE)
length(x) == 1L && .is_character(x, na.ok, zchar)

.is_scalar_character_or_NULL <- function(x, na.ok = FALSE, zchar = FALSE)
.is_scalar_character(x, na.ok, zchar) || is.null(x)

.is_character_0_or_1 <-
function(x, na.ok = FALSE, zchar = FALSE)
{
Expand Down
8 changes: 5 additions & 3 deletions man/avworkflow.Rd

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

0 comments on commit 476e977

Please sign in to comment.