diff --git a/DESCRIPTION b/DESCRIPTION index 46fe16b..40502c1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: NPSutils Type: Package Title: Collection of Functions to read and manipulate information from the NPS DataStore -Version: 1.1.0 +Version: 1.2.0 Authors@R: c( person(given = "Robert", family = "Baker", email = "robert_baker@nps.gov", role = c("aut", "cre"), @@ -41,7 +41,7 @@ Imports: purrr, tibble, lifecycle -RoxygenNote: 7.3.2 +RoxygenNote: 7.3.3 Suggests: httptest, knitr, diff --git a/NEWS.md b/NEWS.md index cc8064b..366b992 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,10 +1,19 @@ -# NPSutils 1.1.0 +# NPSutils 1.2.0 ("Apostle Islands Ice Caves") +## 2026-02-20 + * Fix unit tests that were failing when switched from v7 to v8 DataStore API + * Update to version 1.2.0 in DESCRIPTION files in anticipation of a new release + +## 2026-02-12 + * Fix bug in `get_data_packages` that was causing an error when simultaneously attempting to download multiple data packages. + ## 2026-01-02 * DataStore API calls now use v8 endpoints (v7 was deprecated with DataStore 4.0 release) ## 2025-09-15 * Update Unit service API to use current version (instead of discontinued legacy endpoint) - + +# NPSutils 1.1.0 + ## 2025-05-16 * Add a vignette going over basic functions and how to use NPSutils diff --git a/R/getReferenceInfo.R b/R/getReferenceInfo.R index d6179e0..c8bee46 100644 --- a/R/getReferenceInfo.R +++ b/R/getReferenceInfo.R @@ -23,8 +23,8 @@ get_park_taxon_refs <- function(park_code, taxon_code) { park_code, "/", taxon_code) - DSReference <- httr::content(httr::GET( - url, httr::authenticate(":", ":", "ntlm") + DSReference <- httr::content(httr::GET(url, + httr::authenticate(":", ":", "ntlm") )) %>% dplyr::bind_rows() return(DSReference) diff --git a/R/get_data_packages.R b/R/get_data_packages.R index bef2818..0897b10 100644 --- a/R/get_data_packages.R +++ b/R/get_data_packages.R @@ -55,7 +55,7 @@ get_data_packages <- function(reference_id, } # does reference exist? exists <- NPSutils::check_ref_exists( - reference_id = reference_id, + reference_id = reference_id[i], secure = secure, dev = dev ) @@ -68,7 +68,7 @@ get_data_packages <- function(reference_id, } # is ref a data package? data_package <- check_is_data_package( - reference_id = reference_id, + reference_id = reference_id[i], secure = secure, dev = dev ) @@ -96,7 +96,7 @@ get_data_packages <- function(reference_id, # if interactive, ask whether to download newer version if (force == FALSE) { new_version <- check_new_version( - reference_id = reference_id, + reference_id = reference_id[i], secure = secure, dev = dev ) @@ -110,7 +110,7 @@ get_data_packages <- function(reference_id, var2 <- .get_user_input() if (var2 == 1) { reference_id <- get_new_version_id( - reference_id = reference_id, + reference_id = reference_id[i], secure = secure, dev = dev ) diff --git a/docs/404.html b/docs/404.html index 5c1adcb..8497d75 100644 --- a/docs/404.html +++ b/docs/404.html @@ -20,7 +20,7 @@ NPSutils - 1.1.0 + 1.2.0 "; + if (ClipboardJS.isSupported()) { + $(document).ready(function () { + var copyButton = ""; - $("div.sourceCode").addClass("hasCopyButton"); + $("div.sourceCode").addClass("hasCopyButton"); - // Insert copy buttons: - $(copyButton).prependTo(".hasCopyButton"); + // Insert copy buttons: + $(copyButton).prependTo(".hasCopyButton"); - // Initialize tooltips: - $('.btn-copy-ex').tooltip({container: 'body'}); + // Initialize tooltips: + $('.btn-copy-ex').tooltip({ container: 'body' }); - // Initialize clipboard: - var clipboard = new ClipboardJS('[data-clipboard-copy]', { - text: function(trigger) { - return trigger.parentNode.textContent.replace(/\n#>[^\n]*/g, ""); - } - }); + // Initialize clipboard: + var clipboard = new ClipboardJS('[data-clipboard-copy]', { + text: function (trigger) { + return trigger.parentNode.textContent.replace(/\n#>[^\n]*/g, ""); + } + }); - clipboard.on('success', function(e) { - changeTooltipMessage(e.trigger, 'Copied!'); - e.clearSelection(); - }); + clipboard.on('success', function (e) { + changeTooltipMessage(e.trigger, 'Copied!'); + e.clearSelection(); + }); - clipboard.on('error', function(e) { - changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); - }); + clipboard.on('error', function (e) { + changeTooltipMessage(e.trigger, 'Press Ctrl+C or Command+C to copy'); + }); - }); - } + }); + } /* Search marking --------------------------*/ var url = new URL(window.location.href); @@ -80,80 +80,80 @@ }); } - /* Search --------------------------*/ - /* Adapted from https://github.com/rstudio/bookdown/blob/2d692ba4b61f1e466c92e78fd712b0ab08c11d31/inst/resources/bs4_book/bs4_book.js#L25 */ + /* Search --------------------------*/ + /* Adapted from https://github.com/rstudio/bookdown/blob/2d692ba4b61f1e466c92e78fd712b0ab08c11d31/inst/resources/bs4_book/bs4_book.js#L25 */ // Initialise search index on focus - var fuse; - $("#search-input").focus(async function(e) { - if (fuse) { - return; - } - - $(e.target).addClass("loading"); - var response = await fetch($("#search-input").data("search-index")); - var data = await response.json(); + var fuse; + $("#search-input").focus(async function (e) { + if (fuse) { + return; + } + + $(e.target).addClass("loading"); + var response = await fetch($("#search-input").data("search-index")); + var data = await response.json(); + + var options = { + keys: ["what", "text", "code"], + ignoreLocation: true, + threshold: 0.1, + includeMatches: true, + includeScore: true, + }; + fuse = new Fuse(data, options); + + $(e.target).removeClass("loading"); + }); + // Use algolia autocomplete var options = { - keys: ["what", "text", "code"], - ignoreLocation: true, - threshold: 0.1, - includeMatches: true, - includeScore: true, + autoselect: true, + debug: true, + hint: false, + minLength: 2, }; - fuse = new Fuse(data, options); - - $(e.target).removeClass("loading"); - }); - - // Use algolia autocomplete - var options = { - autoselect: true, - debug: true, - hint: false, - minLength: 2, - }; - var q; -async function searchFuse(query, callback) { - await fuse; - - var items; - if (!fuse) { - items = []; - } else { - q = query; - var results = fuse.search(query, { limit: 20 }); - items = results - .filter((x) => x.score <= 0.75) - .map((x) => x.item); - if (items.length === 0) { - items = [{dir:"Sorry 😿",previous_headings:"",title:"No results found.",what:"No results found.",path:window.location.href}]; + var q; + async function searchFuse(query, callback) { + await fuse; + + var items; + if (!fuse) { + items = []; + } else { + q = query; + var results = fuse.search(query, { limit: 20 }); + items = results + .filter((x) => x.score <= 0.75) + .map((x) => x.item); + if (items.length === 0) { + items = [{ dir: "Sorry 😿", previous_headings: "", title: "No results found.", what: "No results found.", path: window.location.href }]; + } + } + callback(items); } - } - callback(items); -} - $("#search-input").autocomplete(options, [ - { - name: "content", - source: searchFuse, - templates: { - suggestion: (s) => { - if (s.title == s.what) { - return `${s.dir} >
${s.title}
`; - } else if (s.previous_headings == "") { - return `${s.dir} >
${s.title}
> ${s.what}`; - } else { - return `${s.dir} >
${s.title}
> ${s.previous_headings} > ${s.what}`; - } + $("#search-input").autocomplete(options, [ + { + name: "content", + source: searchFuse, + templates: { + suggestion: (s) => { + if (s.title == s.what) { + return `${s.dir} >
${s.title}
`; + } else if (s.previous_headings == "") { + return `${s.dir} >
${s.title}
> ${s.what}`; + } else { + return `${s.dir} >
${s.title}
> ${s.previous_headings} > ${s.what}`; + } + }, }, }, - }, - ]).on('autocomplete:selected', function(event, s) { - window.location.href = s.path + "?q=" + q + "#" + s.id; - }); + ]).on('autocomplete:selected', function (event, s) { + window.location.href = s.path + "?q=" + q + "#" + s.id; + }); }); })(window.jQuery || window.$) -document.addEventListener('keydown', function(event) { +document.addEventListener('keydown', function (event) { // Check if the pressed key is '/' if (event.key === '/') { event.preventDefault(); // Prevent any default action associated with the '/' key diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 1eaa0a6..6da1bb1 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,9 +1,9 @@ pandoc: 3.6.3 -pkgdown: 2.1.1 +pkgdown: 2.2.0 pkgdown_sha: ~ articles: NPSutils: NPSutils.html -last_built: 2026-01-02T16:38Z +last_built: 2026-02-20T18:47Z urls: reference: https://nationalparkservice.github.io/NPSutils/reference article: https://nationalparkservice.github.io/NPSutils/articles diff --git a/docs/reference/NPSutils-package.html b/docs/reference/NPSutils-package.html index b5459ad..d4d08a5 100644 --- a/docs/reference/NPSutils-package.html +++ b/docs/reference/NPSutils-package.html @@ -7,7 +7,7 @@ NPSutils - 1.1.0 + 1.2.0