Skip to content

Commit

Permalink
Merge pull request e-sensing#1122 from M3nin0/cran/1.5.0
Browse files Browse the repository at this point in the history
fix cran notes
  • Loading branch information
gilbertocamara committed May 7, 2024
2 parents 2dbdb82 1782014 commit ca22a65
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
7 changes: 6 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 93,10 @@ S3method(.data_get_ts,raster_cube)
S3method(.gc_arrange_images,raster_cube)
S3method(.mosaic_split_band_date,derived_cube)
S3method(.mosaic_split_band_date,raster_cube)
S3method(.opensearch_cdse_extract_tile,RTC)
S3method(.opensearch_cdse_extract_tile,S2MSI2A)
S3method(.opensearch_cdse_search,RTC)
S3method(.opensearch_cdse_search,S2MSI2A)
S3method(.raster_check_package,terra)
S3method(.raster_col,terra)
S3method(.raster_crop,terra)
Expand Down Expand Up @@ -414,7 418,8 @@ S3method(summary,sits_accuracy)
S3method(summary,sits_area_accuracy)
export("sits_bands<-")
export("sits_labels<-")
export(.mpc_clean_token_cache)
export(.opensearch_cdse_extract_tile)
export(.opensearch_cdse_search)
export(impute_linear)
export(sits_accuracy)
export(sits_accuracy_summary)
Expand Down
14 changes: 13 additions & 1 deletion R/api_opensearch.R
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 156,14 @@
#' from `rstac`.
#' @param items List of features compatible with `rstac` (`rstac::doc_items`).
#' @return List of tiles.
#' @export
.opensearch_cdse_extract_tile <- function(items) {
UseMethod(".opensearch_cdse_extract_tile")
}

#' @keywords internal
#' @noRd
#' @export
.opensearch_cdse_extract_tile.S2MSI2A <- function(items) {
items_titles <- rstac::items_reap(items, field = c("properties", "title"))
purrr::map(items_titles, function(item_title) {
Expand All @@ -173,6 175,7 @@

#' @keywords internal
#' @noRd
#' @export
.opensearch_cdse_extract_tile.RTC <- function(items) {
"NoTilingSystem"
}
Expand All @@ -191,31 194,39 @@
#' @param collection Open Search collection endpoint.
#' @param start_date Start date.
#' @param end_date End date.
#' @param bbox Bounding box of the area from data must be from
#' @param bbox Bounding box of the area from data must be from.
#' @param platform Optional parameter specifying the platform in case of
#' collections that include more than one satellite
#' @param orbit Orbit name ("ascending", "descending") for SAR cubes.
#' @param paginate A Boolean flag that indicates whether pagination
#' should be used.
#' @param limit Limit of content to be retrieved per page. Use `paginate`
#' to manage if multiple pages should be requested.
#' @return List of features compatible with
#' `rstac` (`rstac::doc_items`).
#' @export
.opensearch_cdse_search <- function(product_type,
source,
collection,
start_date,
end_date,
bbox,
platform,
orbit = NULL,
paginate = TRUE,
limit = 1000, ...) {
UseMethod(".opensearch_cdse_search")
}

#' @keywords internal
#' @noRd
#' @export
.opensearch_cdse_search.S2MSI2A <- function(product_type,
source, collection,
start_date, end_date,
bbox,
platform = NULL,
orbit = NULL,
paginate = TRUE,
limit = 1000, ...) {
.check_set_caller(".opensearch_cdse_search_s2msi2a")
Expand All @@ -238,6 249,7 @@

#' @keywords internal
#' @noRd
#' @export
.opensearch_cdse_search.RTC <- function(product_type,
source, collection,
start_date, end_date,
Expand Down
1 change: 0 additions & 1 deletion R/api_source_cdse.R
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 181,6 @@
#' @param multicores Number of workers used to create the CDSE cube.
#' @param platform Satellite platform (not supported).
#' @return An object referring the images of a sits cube.
#'
#' @export
.source_items_new.cdse_cube <- function(source, ...,
collection,
Expand Down
6 changes: 2 additions & 4 deletions R/api_source_mpc.R
Original file line number Diff line number Diff line change
Expand Up @@ -523,14 523,12 @@
.check_that(.has_not(tiles))
return(invisible(source))
}
#' @title Cleak MPC token cache
#' @title Clear MPC token cache
#' @name .mpc_clean_token_cache
#' @description
#' Cleans the the token cache for MPC to reduce timeout effects
#' @description Cleans the the token cache for MPC to reduce timeout effects
#' @return Called for side effects.
#' @keywords internal
#' @noRd
#' @export
.mpc_clean_token_cache <- function() {
mpc_token <- get("ms_token", envir = asNamespace("rstac"), inherits = TRUE)
cached_tokens <- names(mpc_token)
Expand Down

0 comments on commit ca22a65

Please sign in to comment.