diff --git a/R/AddStep.R b/R/AddStep.R index c34e1b0c8b03dc545c7cffe5e63363a33de1fac4..955ed847ac2db51eb568eac51b2f1b6005fa91eb 100644 --- a/R/AddStep.R +++ b/R/AddStep.R @@ -9,7 +9,7 @@ AddStep <- function(inputs, step_fun, ...) { inputs <- list(inputs) names(inputs) <- 'input1' } - if (is.list(inputs)) { + else if (is.list(inputs)) { if (any(!sapply(inputs, function(x) any(c('startR_cube', 'startR_workflow') %in% class(x))))) { @@ -22,6 +22,15 @@ AddStep <- function(inputs, step_fun, ...) { } # Consistency checks + if (!is.null(attr(step_fun, "UseAttributes"))) { + if (!all(names(inputs) == names(attr(step_fun, "UseAttributes")))) { + names(inputs) <- names(attr(step_fun, "UseAttributes")) + .warning(paste("The name of inputs is not assigned or differs from", + "name of use_attributes list in Step(). Force inputs", + "name to be consistent with use_attributes list")) + } + } + if (length(inputs) != length(attr(step_fun, 'TargetDims'))) { stop("The number of provided 'inputs' (", length(inputs), ") does not ", "match the number of expected inputs by the provided 'step_fun' (",