From 1656d47ecb2397bdb90115a2893e6ed5adc61354 Mon Sep 17 00:00:00 2001 From: ARIADNA BATALLA FERRES Date: Wed, 24 Apr 2024 14:12:03 +0200 Subject: [PATCH 1/3] retrieve=TRUE in example in CST_Start and updated documentation --- R/CST_Start.R | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/R/CST_Start.R b/R/CST_Start.R index 4b78ee0c..12c1de53 100644 --- a/R/CST_Start.R +++ b/R/CST_Start.R @@ -13,6 +13,11 @@ #'auxiliary startR functions (e.g. indices(), values(), Sort(), CircularSort(), #'CDORemapper(), ...) can be used to define dimensions. #' +#'CST_Start() uses as.s2dv_cube() to transform the output into an s2dv_cube +#'object. The as.s2dv_cube() function is designed to be used with data that +#'has been retrieved into memory. To avoid errors, please ensure that +#'CST_Start(..., retrieve = TRUE) is specified. +#' #'@param ... Parameters that are automatically forwarded to the `startR::Start` #' function. See details in `?startR::Start`. #'@examples @@ -33,7 +38,7 @@ #' latitude = c('lat', 'latitude')), #' return_vars = list(time = 'sdate', #' longitude = NULL, latitude = NULL), -#' retrieve = FALSE) +#' retrieve = TRUE) #'} #'\dontshow{ #' exp <- CSTools::lonlat_temp_st$exp -- GitLab From 49ab6734cc2be6a93129020b387f868bc043e728 Mon Sep 17 00:00:00 2001 From: ARIADNA BATALLA FERRES Date: Thu, 25 Apr 2024 10:31:14 +0200 Subject: [PATCH 2/3] Updated as.s2dv_cube.R documentation to include 'startR_cube' error --- R/as.s2dv_cube.R | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/R/as.s2dv_cube.R b/R/as.s2dv_cube.R index f81766ec..85566d85 100644 --- a/R/as.s2dv_cube.R +++ b/R/as.s2dv_cube.R @@ -350,9 +350,14 @@ as.s2dv_cube <- function(object, remove_attrs_coords = FALSE, ## load_parameters result$attrs$load_parameters <- attributes(object)$FileSelectors class(result) <- 's2dv_cube' + } else if (inherits(object, 'startR_cube')) { + stop("Unsupported object class: 'startR_cube'. ", + "When using startR::Start() or CSTools::CST_Start(), set ", + "'retrieve = TRUE' to ensure the data is retrieved into " + "memory and can be converted into a 's2dv_cube' object.") } else { stop("The class of parameter 'object' is not implemented", " to be converted into 's2dv_cube' class yet.") } return(result) -} \ No newline at end of file +} -- GitLab From 03a580d2531d4b327ab3d320ff6502808ccad79c Mon Sep 17 00:00:00 2001 From: ARIADNA BATALLA FERRES Date: Thu, 25 Apr 2024 11:57:14 +0200 Subject: [PATCH 3/3] Fixed pipeline error: missing comma --- R/as.s2dv_cube.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/as.s2dv_cube.R b/R/as.s2dv_cube.R index 85566d85..c504fbcc 100644 --- a/R/as.s2dv_cube.R +++ b/R/as.s2dv_cube.R @@ -353,7 +353,7 @@ as.s2dv_cube <- function(object, remove_attrs_coords = FALSE, } else if (inherits(object, 'startR_cube')) { stop("Unsupported object class: 'startR_cube'. ", "When using startR::Start() or CSTools::CST_Start(), set ", - "'retrieve = TRUE' to ensure the data is retrieved into " + "'retrieve = TRUE' to ensure the data is retrieved into ", "memory and can be converted into a 's2dv_cube' object.") } else { stop("The class of parameter 'object' is not implemented", -- GitLab