From fb15a638b15b508a3c1b153af321ec4b59eedd77 Mon Sep 17 00:00:00 2001 From: vagudets Date: Fri, 5 Apr 2024 14:44:38 +0200 Subject: [PATCH 1/2] Add check for special wildcard '$' --- R/Start.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/R/Start.R b/R/Start.R index 2be297b..b75fa30 100644 --- a/R/Start.R +++ b/R/Start.R @@ -893,6 +893,10 @@ Start <- function(..., # dim = indices/selectors, found_pattern_dim <- found_pattern_dims(pattern_dims, dim_names, var_params, dim_params, dim_reorder_params) + # Check if file pattern contains '$var$' substring + if (!grepl("$var$", dim_params[[found_pattern_dim]], fixed = TRUE)) { + stop("The special wildcard '$var$' must be present in the file path.") + } # Check all *_reorder are NULL or functions, and that they all have # a matching dimension param. i <- 1 -- GitLab From 80c633650e4d75e30186fc478ade51d94f9c06c3 Mon Sep 17 00:00:00 2001 From: vagudets Date: Fri, 5 Apr 2024 15:10:39 +0200 Subject: [PATCH 2/2] Change error to warning --- R/Start.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/Start.R b/R/Start.R index b75fa30..7479bbd 100644 --- a/R/Start.R +++ b/R/Start.R @@ -895,7 +895,9 @@ Start <- function(..., # dim = indices/selectors, # Check if file pattern contains '$var$' substring if (!grepl("$var$", dim_params[[found_pattern_dim]], fixed = TRUE)) { - stop("The special wildcard '$var$' must be present in the file path.") + .warning(paste0("The special wildcard '$var$' is not present in the file ", + "path. This might cause the function to fail if it can not", + "parse the inner dimensions in all the files.")) } # Check all *_reorder are NULL or functions, and that they all have # a matching dimension param. -- GitLab