From e0c78e398c6f0c690971eb4f0ed3a7bf6ca079a0 Mon Sep 17 00:00:00 2001 From: David Blodgett Date: Wed, 20 Mar 2024 21:14:21 -0500 Subject: [PATCH 1/3] fix up documentation for CRAN checks --- R/identifier_exists.R | 2 +- R/item_get.R | 4 ++-- R/item_list_files.R | 4 ++-- R/sb_item.R | 8 ++++---- man/identifier_exists.Rd | 2 +- man/item_get_parent.Rd | 4 ++-- man/item_list_files.Rd | 4 ++-- man/sbitem.Rd | 8 ++++---- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/R/identifier_exists.R b/R/identifier_exists.R index 486cf95..0ea3182 100644 --- a/R/identifier_exists.R +++ b/R/identifier_exists.R @@ -12,7 +12,7 @@ #' @return Logical, \code{TRUE} or \code{FALSE} #' @examples \donttest{ #' # identifier exists -#' identifier_exists(sb_id = "4f4e4b24e4b07f02db6aea14") +#' identifier_exists(sb_id = "57976a0ce4b021cadec97890") #' #' # identifier does not exist #' identifier_exists(sb_id = "aaaaaaakkkkkkkbbbbbb") diff --git a/R/item_get.R b/R/item_get.R index a386803..3d27d29 100644 --- a/R/item_get.R +++ b/R/item_get.R @@ -52,9 +52,9 @@ get_item <- function(id, ...) { #' #' @export #' @examples \donttest{ -#' item_get_parent("4f4e4b24e4b07f02db6aea14") +#' item_get_parent("57976a0ce4b021cadec97890") #' -#' item_get_parent(item_get("4f4e4b24e4b07f02db6aea14")) +#' item_get_parent(item_get("57976a0ce4b021cadec97890")) #' } item_get_parent = function(sb_id, ...) { res <- as.sbitem(sb_id, ...) diff --git a/R/item_list_files.R b/R/item_list_files.R index 61f122d..6969089 100644 --- a/R/item_list_files.R +++ b/R/item_list_files.R @@ -27,10 +27,10 @@ #' @examples \dontrun{ #' #' #regular files -#' item_list_files("4f4e4b24e4b07f02db6aea14") +#' item_list_files("57976a0ce4b021cadec97890") #' #' # files in facets -#' item_list_files("5f6a285d82ce38aaa244912e") +#' item_list_files("5ebe92af82ce476925e44b8f") #' #' # list files recursively #' ## create item diff --git a/R/sb_item.R b/R/sb_item.R index 97ebedf..03d4f3e 100644 --- a/R/sb_item.R +++ b/R/sb_item.R @@ -8,20 +8,20 @@ #' the method for character class inputs #' @examples \donttest{ #' # Single item from item_get() -#' item_get("4f4e4b24e4b07f02db6aea14") +#' item_get("57976a0ce4b021cadec97890") #' #' # Get many w/ e.g., an lapply() call #' library("httr") #' res <- query_items(list(s = "Search", q = "water", format = "json")) -#' if(res$status != 404) { +#' if(res$status == 200) { #' ids <- vapply(httr::content(res)$items, "[[", "", "id") #' (out <- lapply(ids[1:3], item_get)) #' } #' # create item class from only an item ID -#' as.sbitem("4f4e4b24e4b07f02db6aea14") +#' as.sbitem("5ebe92af82ce476925e44b8f") #' #' # sbitem gives back itself -#' (x <- as.sbitem("4f4e4b24e4b07f02db6aea14")) +#' (x <- as.sbitem("5ebe92af82ce476925e44b8f")) #' as.sbitem(x) #' } diff --git a/man/identifier_exists.Rd b/man/identifier_exists.Rd index 5c20ce8..64be49f 100644 --- a/man/identifier_exists.Rd +++ b/man/identifier_exists.Rd @@ -24,7 +24,7 @@ with an item that is unavailable due to permission restrictions. \examples{ \donttest{ # identifier exists -identifier_exists(sb_id = "4f4e4b24e4b07f02db6aea14") +identifier_exists(sb_id = "57976a0ce4b021cadec97890") # identifier does not exist identifier_exists(sb_id = "aaaaaaakkkkkkkbbbbbb") diff --git a/man/item_get_parent.Rd b/man/item_get_parent.Rd index 4bf92b7..cf81048 100644 --- a/man/item_get_parent.Rd +++ b/man/item_get_parent.Rd @@ -21,8 +21,8 @@ item tree hierarchy. } \examples{ \donttest{ -item_get_parent("4f4e4b24e4b07f02db6aea14") +item_get_parent("57976a0ce4b021cadec97890") -item_get_parent(item_get("4f4e4b24e4b07f02db6aea14")) +item_get_parent(item_get("57976a0ce4b021cadec97890")) } } diff --git a/man/item_list_files.Rd b/man/item_list_files.Rd index a2b420a..1ffadad 100644 --- a/man/item_list_files.Rd +++ b/man/item_list_files.Rd @@ -39,10 +39,10 @@ if the file was found in a facet. \dontrun{ #regular files -item_list_files("4f4e4b24e4b07f02db6aea14") +item_list_files("57976a0ce4b021cadec97890") # files in facets -item_list_files("5f6a285d82ce38aaa244912e") +item_list_files("5ebe92af82ce476925e44b8f") # list files recursively ## create item diff --git a/man/sbitem.Rd b/man/sbitem.Rd index 28c5181..9e1f2fd 100644 --- a/man/sbitem.Rd +++ b/man/sbitem.Rd @@ -26,20 +26,20 @@ ScienceBase item class \examples{ \donttest{ # Single item from item_get() -item_get("4f4e4b24e4b07f02db6aea14") +item_get("57976a0ce4b021cadec97890") # Get many w/ e.g., an lapply() call library("httr") res <- query_items(list(s = "Search", q = "water", format = "json")) -if(res$status != 404) { +if(res$status == 200) { ids <- vapply(httr::content(res)$items, "[[", "", "id") (out <- lapply(ids[1:3], item_get)) } # create item class from only an item ID -as.sbitem("4f4e4b24e4b07f02db6aea14") +as.sbitem("5ebe92af82ce476925e44b8f") # sbitem gives back itself -(x <- as.sbitem("4f4e4b24e4b07f02db6aea14")) +(x <- as.sbitem("5ebe92af82ce476925e44b8f")) as.sbitem(x) } } From fb9fedf81bb0f8c764404f2fdba533355cd24871 Mon Sep 17 00:00:00 2001 From: David Blodgett Date: Wed, 20 Mar 2024 21:15:57 -0500 Subject: [PATCH 2/3] update version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 88bdbf1..f73e700 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: sbtools Title: USGS ScienceBase Tools Maintainer: David Blodgett -Version: 1.3.1 +Version: 1.3.2 Authors@R: c(person("David", "Blodgett", role=c("cre"), email = "dblodgett@usgs.gov"), person("Luke", "Winslow", role = c("aut"), From e7314f8b09b3dc240f5cff7a7ff25e270e754158 Mon Sep 17 00:00:00 2001 From: David Blodgett Date: Wed, 20 Mar 2024 21:22:04 -0500 Subject: [PATCH 3/3] update news --- NEWS.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/NEWS.md b/NEWS.md index b4c5ce7..8985f3a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,11 @@ +# version 1.3.2 + +- `item_rm_files()` now uses cloud end point. #315 +- `initialize_sciencebase_session()` has less warnings. #319 and #323 +- `initialize_sciencebase_session()` works at the terminal now. #317 +- `initialize_sciencebase_session()` caching works better. #318 +- improve test coverage #316 + # version 1.3.1 Improved handling of cached token.