From a08dbd9a2388f7c7a495de7a6858f88ac2cbf06b Mon Sep 17 00:00:00 2001 From: Felipe Carlos Date: Fri, 31 Jan 2025 11:26:19 -0300 Subject: [PATCH] fix parse query string --- DESCRIPTION | 2 +- R/api_cube.R | 2 +- R/api_request_httr2.R | 13 +++++++++++++ man/sits_classify.Rd | 12 +++++++----- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index c55592bc6..88b678abd 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -88,7 +88,7 @@ Suggests: gdalcubes (>= 0.7.0), geojsonsf, ggplot2, - httr2, + httr2 (>= 1.1.0), jsonlite, kohonen (>= 3.0.11), leaflet (>= 2.2.0), diff --git a/R/api_cube.R b/R/api_cube.R index 62c251609..26a5894eb 100644 --- a/R/api_cube.R +++ b/R/api_cube.R @@ -1444,7 +1444,7 @@ NULL # check that token is valid .check_that(.has(res_content)) # parse token - token_parsed <- .url_parse(paste0("?", res_content[["token"]])) + token_parsed <- .url_parse_query(res_content[["token"]]) file_info[["path"]] <- purrr::map_chr(seq_along(fi_paths), function(i) { path <- fi_paths[[i]] if (are_local_paths[[i]]) { diff --git a/R/api_request_httr2.R b/R/api_request_httr2.R index 4339aaf1d..08b011d24 100644 --- a/R/api_request_httr2.R +++ b/R/api_request_httr2.R @@ -223,6 +223,19 @@ httr2::url_parse(url) } +#' @title Parse URL +#' @name .url_parse_query +#' @keywords internal +#' @noRd +#' @author Felipe Carvalho, \email{felipe.carvalho@@inpe.br} +#' +#' @param url A character with URL query string. +#' +#' @return An character vector with parsed URL query string. +.url_parse_query <- function(url) { + httr2::url_parse(url) +} + #' @title Build an URL #' @name .url_build #' @keywords internal diff --git a/man/sits_classify.Rd b/man/sits_classify.Rd index f133d2b6d..8a26426ef 100644 --- a/man/sits_classify.Rd +++ b/man/sits_classify.Rd @@ -137,7 +137,8 @@ SITS supports the following models: (c) extreme gradient boosting: \code{\link[sits]{sits_xgboost}}; (d) multi-layer perceptrons: \code{\link[sits]{sits_mlp}}; (e) 1D CNN: \code{\link[sits]{sits_tempcnn}}; -(f) self-attention encoders: \code{\link[sits]{sits_lighttae}}. +(f) self-attention encoders: \code{\link[sits]{sits_lighttae}} and + \code{\link[sits]{sits_tae}} } \note{ The \code{roi} parameter defines a region of interest. It can be @@ -165,10 +166,11 @@ The \code{roi} parameter defines a region of interest. It can be Use an sf object or a shapefile to define it. When using a GPU for deep learning, \code{gpu_memory} indicates the - memory of available in the graphics card. The parameter \code{batch_size} - defines the size of the matrix (measured in number of rows) - which is sent to the GPU for classification. Users can test - different sizes to best fit their GPU architecture. + memory of the graphics card which is available for processing. + The parameter \code{batch_size} defines the size of the matrix + (measured in number of rows) which is sent to the GPU for classification. + Users can test different values of \code{batch_size} to + find out which one best fits their GPU architecture. It is not possible to have an exact idea of the size of Deep Learning models in GPU memory, as the complexity of the model and factors