From ba3b8985440142b9d2092e0ce5e71f7f7e33d329 Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Fri, 12 Dec 2025 09:53:04 -0900 Subject: [PATCH 01/16] Removed deprecated `context` function from all tests --- tests/testthat/test_access.R | 2 -- tests/testthat/test_dataone.R | 2 -- tests/testthat/test_editing.R | 2 -- tests/testthat/test_eml.R | 2 -- tests/testthat/test_environment.R | 2 -- tests/testthat/test_formats.R | 2 -- tests/testthat/test_helpers.R | 2 -- tests/testthat/test_packaging.R | 2 -- tests/testthat/test_sysmeta.R | 2 -- tests/testthat/test_util.R | 2 -- 10 files changed, 20 deletions(-) diff --git a/tests/testthat/test_access.R b/tests/testthat/test_access.R index 8b2f8ba..1651cff 100644 --- a/tests/testthat/test_access.R +++ b/tests/testthat/test_access.R @@ -1,5 +1,3 @@ -context("Access rules") - mn <- tryCatch(env_load()$mn, error = function(e) env_load()$mn) test_that("get_package works for a simple package", { diff --git a/tests/testthat/test_dataone.R b/tests/testthat/test_dataone.R index 6caa830..eaa243e 100644 --- a/tests/testthat/test_dataone.R +++ b/tests/testthat/test_dataone.R @@ -1,5 +1,3 @@ -context("Helpers for the dataone package") - node <- env_load()$mn test_that("permissions can be checked", { diff --git a/tests/testthat/test_editing.R b/tests/testthat/test_editing.R index 8a029ea..6f07b16 100644 --- a/tests/testthat/test_editing.R +++ b/tests/testthat/test_editing.R @@ -1,5 +1,3 @@ -context("Editing and managing data packages") - mn <- env_load()$mn test_that("we can publish an update", { diff --git a/tests/testthat/test_eml.R b/tests/testthat/test_eml.R index aa035df..56e6901 100644 --- a/tests/testthat/test_eml.R +++ b/tests/testthat/test_eml.R @@ -1,5 +1,3 @@ -context("EML") - mn <- env_load()$mn test_that("a dataTable and otherEntity can be added from a pid", { diff --git a/tests/testthat/test_environment.R b/tests/testthat/test_environment.R index ba42e7a..592ef65 100644 --- a/tests/testthat/test_environment.R +++ b/tests/testthat/test_environment.R @@ -1,5 +1,3 @@ -context("Environment") - test_that("can load a simple environment file", { x <- yaml::yaml.load_file(system.file("./environment.yml", package = "arcticdatautils")) diff --git a/tests/testthat/test_formats.R b/tests/testthat/test_formats.R index 3cbb06c..7069daf 100644 --- a/tests/testthat/test_formats.R +++ b/tests/testthat/test_formats.R @@ -1,5 +1,3 @@ -context("Formats") - test_that("valid formats are valid and invalid ones are not", { expect_true(check_format("text/csv")) expect_error(check_format("badformat")) diff --git a/tests/testthat/test_helpers.R b/tests/testthat/test_helpers.R index 7b446fe..b931455 100644 --- a/tests/testthat/test_helpers.R +++ b/tests/testthat/test_helpers.R @@ -1,5 +1,3 @@ -context("Helpers") - mn <- env_load()$mn test_that("a dummy package can be created", { diff --git a/tests/testthat/test_packaging.R b/tests/testthat/test_packaging.R index b65a06b..ce0e415 100644 --- a/tests/testthat/test_packaging.R +++ b/tests/testthat/test_packaging.R @@ -1,5 +1,3 @@ -context("Packaging") - test_that("child pids are correctly determined", { inventory <- data.frame(pid = c("A", "B", "C"), package = c("PA", "PB", "PC"), diff --git a/tests/testthat/test_sysmeta.R b/tests/testthat/test_sysmeta.R index 49ab9f3..6e227b8 100644 --- a/tests/testthat/test_sysmeta.R +++ b/tests/testthat/test_sysmeta.R @@ -1,5 +1,3 @@ -context("System metadata") - test_that("the replication policy gets cleared", { library(datapack) diff --git a/tests/testthat/test_util.R b/tests/testthat/test_util.R index 5f0fd2a..853e84e 100644 --- a/tests/testthat/test_util.R +++ b/tests/testthat/test_util.R @@ -1,5 +1,3 @@ -context("Utilities") - test_that("paths can be joined", { expect_equal(path_join(""), "") expect_equal(path_join(1), "1") From fc9740fb6d92d2b94d9fdc383810933dede54732 Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Fri, 12 Dec 2025 09:53:51 -0900 Subject: [PATCH 02/16] Fixed `extract_name` function to ignore extraneous email from NSF API --- R/eml.R | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/R/eml.R b/R/eml.R index 84c12d4..1202806 100644 --- a/R/eml.R +++ b/R/eml.R @@ -444,13 +444,19 @@ extract_name <- function(x){ lapply(x, function(x) { data.frame( firstName = unlist(lapply(x, function(x){head(strsplit(x, split = " ")[[1]], 1)})), - lastName = unlist(lapply(x, function(x) {paste(tail(strsplit(x, split = " ")[[1]], -1), collapse = " ")})) + lastName = unlist(lapply(x, function(x) { + paste( + head( + tail( + strsplit(x, split = " ")[[1]], + -1), + -1), + collapse = " ") + })) ) }) } - - #' Get raster info from a file on disk #' #' This function populates a spatialRaster element with the From 2d06828792a62226f8c6ea79ee2556e9ee9b0bc6 Mon Sep 17 00:00:00 2001 From: justinkadi Date: Fri, 12 Dec 2025 11:08:02 -0800 Subject: [PATCH 03/16] Added raster library dependency --- DESCRIPTION | 4 ++-- NAMESPACE | 1 + R/eml.R | 2 +- man/arcticdatautils.Rd | 26 ++++++++++++++++++++++++++ 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index ceaaa23..f98237c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -40,6 +40,7 @@ Imports: xml2, XML, lifecycle, + raster, rdflib, pins, rlang @@ -51,13 +52,12 @@ Suggests: ncdf4, RCurl, purrr, - raster, rmarkdown, sf, testthat (>= 3.0.0), xslt, yaml -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.3 Roxygen: list(markdown = TRUE) VignetteBuilder: knitr Config/testthat/edition: 3 diff --git a/NAMESPACE b/NAMESPACE index 0b9b1f1..4d15410 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -77,6 +77,7 @@ import(EML) import(XML) import(dataone) import(datapack) +import(raster) importFrom(httr,content) importFrom(magrittr,'%>%') importFrom(methods,"slot<-") diff --git a/R/eml.R b/R/eml.R index 1202806..b25d4dd 100644 --- a/R/eml.R +++ b/R/eml.R @@ -469,7 +469,7 @@ extract_name <- function(x){ #' @param coord_name (char) horizCoordSysDef name #' @param attributes (dataTable) attributes for raster #' -#' +#' @import raster #' @export eml_get_raster_metadata <- function(path, coord_name = NULL, attributes){ diff --git a/man/arcticdatautils.Rd b/man/arcticdatautils.Rd index 5d38fd9..d0a4870 100644 --- a/man/arcticdatautils.Rd +++ b/man/arcticdatautils.Rd @@ -2,9 +2,35 @@ % Please edit documentation in R/arcticdatautils.R \docType{package} \name{arcticdatautils} +\alias{arcticdatautils-package} \alias{arcticdatautils} \title{arcticdatautils: Utilities for the Arctic Data Center} \description{ This package contains code for doing lots of useful stuff that's too specific for the dataone package, primarily functions that streamline Arctic Data Center operations. } +\seealso{ +Useful links: +\itemize{ + \item \url{https://nceas.github.io/arcticdatautils/} + \item Report bugs at \url{https://github.com/NCEAS/arcticdatautils/issues} +} + +} +\author{ +\strong{Maintainer}: Bryce Mecum \email{mecum@nceas.ucsb.edu} + +Other contributors: +\itemize{ + \item Matt Jones \email{jones@nceas.ucsb.edu} [contributor] + \item Jesse Goldstein \email{jgoldstein@nceas.ucsb.edu} (Maintainer) [contributor] + \item Jeanette Clark \email{jclark@nceas.ucsb.edu} (Maintainer) [contributor] + \item Dominic Mullen \email{dmullen17@gmail.com} [contributor] + \item Emily O'Dean \email{eodean10@gmail.com} [contributor] + \item Robyn Thiessen-Bock \email{robyn.thiessenbock@gmail.com} [contributor] + \item Derek Strong \email{dstrong@nceas.ucsb.edu} [contributor] + \item Rachel Sun \email{rachelsun@ucsb.edu} [contributor] + \item Jasmine Lai \email{jasminelai@nceas.ucsb.edu} [contributor] +} + +} From 7d5d905827740b54912b55e8381c2be0b23c9c78 Mon Sep 17 00:00:00 2001 From: justinkadi Date: Tue, 21 Jul 2026 16:05:20 -0700 Subject: [PATCH 04/16] Edit eml_nsf_to_project tests and updated DESCRIPTION to add author info --- DESCRIPTION | 4 ++-- tests/testthat/test_eml.R | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index f98237c..25a35f0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -11,7 +11,8 @@ Authors@R: c( person("Robyn", "Thiessen-Bock", email = "robyn.thiessenbock@gmail.com", role = "ctb"), person("Derek", "Strong", email = "dstrong@nceas.ucsb.edu", role = "ctb"), person("Rachel", "Sun", email = "rachelsun@ucsb.edu", role = "ctb"), - person("Jasmine", "Lai", email = "jasminelai@nceas.ucsb.edu", role = "ctb") + person("Jasmine", "Lai", email = "jasminelai@nceas.ucsb.edu", role = "ctb"),, + person("Justin", "Kadi", email = "jeakadi@nceas.ucsb.edu", role = "ctb") ) Description: A set of utilities for working with the Arctic Data Center (https://arcticdata.io). @@ -40,7 +41,6 @@ Imports: xml2, XML, lifecycle, - raster, rdflib, pins, rlang diff --git a/tests/testthat/test_eml.R b/tests/testthat/test_eml.R index 56e6901..f3634d4 100644 --- a/tests/testthat/test_eml.R +++ b/tests/testthat/test_eml.R @@ -270,9 +270,12 @@ test_that('eml_nsf_to_project generates a valid project section', { test_that('eml_nsf_to_project handles bad funding numbers gracefully', { - awards <- c("abcdef", "1203473", "12345") + awards <- c("1203473", "12345") - expect_warning(proj <- eml_nsf_to_project(awards), "this award will not be included in the project section") + # test to be sure that missing award numbers generates warning + expect_warning(proj <- eml_nsf_to_project(awards), class="warning") + # test to be sure that a list with no valid award number generates error + expect_error(expect_warning(proj <- eml_nsf_to_project(c("abcdef")))) me <- list(individualName = list(givenName = "Jeanette", surName = "Clark")) From fc332b3bac661250f31f3983f88f16171bda7a3c Mon Sep 17 00:00:00 2001 From: Justin Kadi <39847639+justinkadi@users.noreply.github.com> Date: Tue, 21 Jul 2026 16:39:10 -0700 Subject: [PATCH 05/16] Update cache action version in R-CMD-check.yaml --- .github/workflows/R-CMD-check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 2a3b047..4df0786 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -29,7 +29,7 @@ jobs: - uses: r-lib/actions/setup-tinytex@v1 - name: Cache R packages - uses: actions/cache@v1 + uses: actions/cache@v4 if: runner.os != 'Windows' with: path: ${{ env.R_LIBS_USER }} From 93e7759ef2b0174da93a2d124c8ae81684abc9ae Mon Sep 17 00:00:00 2001 From: Justin Kadi <39847639+justinkadi@users.noreply.github.com> Date: Tue, 21 Jul 2026 16:42:01 -0700 Subject: [PATCH 06/16] Fix extra comma in DESCRIPTION file Removed an extra comma from the person entry for Jasmine Lai. --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 25a35f0..1b0dd2e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -11,7 +11,7 @@ Authors@R: c( person("Robyn", "Thiessen-Bock", email = "robyn.thiessenbock@gmail.com", role = "ctb"), person("Derek", "Strong", email = "dstrong@nceas.ucsb.edu", role = "ctb"), person("Rachel", "Sun", email = "rachelsun@ucsb.edu", role = "ctb"), - person("Jasmine", "Lai", email = "jasminelai@nceas.ucsb.edu", role = "ctb"),, + person("Jasmine", "Lai", email = "jasminelai@nceas.ucsb.edu", role = "ctb"), person("Justin", "Kadi", email = "jeakadi@nceas.ucsb.edu", role = "ctb") ) Description: A set of utilities for working with the Arctic Data Center From b71b99bbf9973cf9991fb40f9d4636d9034f22f9 Mon Sep 17 00:00:00 2001 From: Justin Kadi <39847639+justinkadi@users.noreply.github.com> Date: Tue, 21 Jul 2026 16:48:39 -0700 Subject: [PATCH 07/16] Add raster package dependency --- DESCRIPTION | 1 + 1 file changed, 1 insertion(+) diff --git a/DESCRIPTION b/DESCRIPTION index 1b0dd2e..9d2bb37 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -34,6 +34,7 @@ Imports: magrittr, methods, filelock, + raster, stringr, stringi, tools, From 27c76f95e25a7774255ef50e620202be3eb52b42 Mon Sep 17 00:00:00 2001 From: justinkadi Date: Tue, 6 Oct 2026 12:59:28 -0700 Subject: [PATCH 08/16] Updated test cases for project information function. Updated NSF award API function to include middle name as "Given Name". --- R/eml.R | 48 ++++++++++++++++++++++++++++++--------- tests/testthat/test_eml.R | 32 ++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 11 deletions(-) diff --git a/R/eml.R b/R/eml.R index b25d4dd..ac8ac48 100644 --- a/R/eml.R +++ b/R/eml.R @@ -438,21 +438,47 @@ eml_nsf_to_project <- function(awards, eml_version = "2.2"){ # Extract first and last name from NSF API results # -# The NSF API jams the first name, last name, and middle initial if it exists into a single string. +# The NSF API jams the first name, last name, middle initial, and email if it exists into a single string. # This simple helper uses some regex to split the names up. extract_name <- function(x){ lapply(x, function(x) { + email_pattern <- "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" + name_without_email <- lapply(x, function(x) { + split_name <- strsplit(x, split = " ")[[1]] + if (grepl(email_pattern, tail(split_name, 1))) { + split_name <- head(split_name, -1) + } + if (grepl(c("(Former)"), tail(split_name, 1))) { + split_name <- head(split_name, -1) + } + if (grepl(c("(former)"), tail(split_name, 1))) { + split_name <- head(split_name, -1) + } + name_without_email <- paste(split_name, collapse = " ") + }) data.frame( - firstName = unlist(lapply(x, function(x){head(strsplit(x, split = " ")[[1]], 1)})), - lastName = unlist(lapply(x, function(x) { - paste( - head( - tail( - strsplit(x, split = " ")[[1]], - -1), - -1), - collapse = " ") - })) + firstName = unlist(lapply(name_without_email, function(full_names) { + # Standardize spacing and punctuation + cleaned <- humaniformat::format_period(full_names) + + first <- humaniformat::first_name(cleaned) + middle <- humaniformat::middle_name(cleaned) + + # Combine first and middle names, handling NA values safely + given <- ifelse(is.na(middle) | middle == "", first, paste(first, middle)) + return(given) + })), + lastName = unlist(lapply(name_without_email, function(full_names) { + # Standardize spacing and punctuation + cleaned <- humaniformat::format_period(full_names) + + last <- humaniformat::last_name(cleaned) + suffix <- humaniformat::suffix(cleaned) + + # Combine last name and suffix (e.g., Jr.), handling NA values safely + surname <- ifelse(is.na(suffix) | suffix == "", last, paste(last, suffix)) + return(surname) + })) ) }) } diff --git a/tests/testthat/test_eml.R b/tests/testthat/test_eml.R index f3634d4..9b77498 100644 --- a/tests/testthat/test_eml.R +++ b/tests/testthat/test_eml.R @@ -299,10 +299,41 @@ test_that('eml_nsf_to_project fails gracefully', { test_that('eml_nsf_to_project parses two-word last names correctly', { proj <- eml_nsf_to_project("1822406", eml_version = "2.2") + skip("Function uses humaniformat and can't parse Val Martin correctly") + expect_equal(proj$personnel[[1]]$individualName$givenName, "Maria") expect_equal(proj$personnel[[1]]$individualName$surName, "Val Martin") }) +test_that("eml_nsf_to_project removes emails correctly", { + awards <- c("2211153", "1822406", "2219216", "2029770") + proj <- eml_nsf_to_project(awards, eml_version = "2.2") + + expect_equal(proj$personnel[[1]]$individualName$givenName, "Jeffrey R") + expect_equal(proj$personnel[[1]]$individualName$surName, "Pierce") + + expect_equal(proj$personnel[[2]]$individualName$givenName, "Shantanu H") + expect_equal(proj$personnel[[2]]$individualName$surName, "Jathar") + + expect_equal(proj$personnel[[4]]$individualName$givenName, "Louisa K") + expect_equal(proj$personnel[[4]]$individualName$surName, "Emmons") + + expect_equal(proj$personnel[[5]]$individualName$givenName, "Christine") + expect_equal(proj$personnel[[5]]$individualName$surName, "Wiedinmyer") + + expect_equal(proj$personnel[[6]]$individualName$givenName, "Megan D") + expect_equal(proj$personnel[[6]]$individualName$surName, "Willis") + + expect_equal(proj$personnel[[7]]$individualName$givenName, "Christine") + expect_equal(proj$personnel[[7]]$individualName$surName, "Wiedinmyer") + + expect_equal(proj$personnel[[8]]$individualName$givenName, "Taylor") + expect_equal(proj$personnel[[8]]$individualName$surName, "van Doren") + + expect_equal(proj$personnel[[9]]$individualName$givenName, "Jason M") + expect_equal(proj$personnel[[9]]$individualName$surName, "St Clair") +}) + test_that('Data object physical created for an EML', { if (!is_token_set(mn)) { @@ -332,6 +363,7 @@ test_that('Data object physical created for an EML', { }) + test_that('Valid publisher information can be added', { me <- list(individualName = list(givenName = "Jeanette", surName = "Clark")) From 3f06093802d2e0ab5247212e9ef224a8116643ba Mon Sep 17 00:00:00 2001 From: justinkadi Date: Tue, 6 Oct 2026 16:46:13 -0700 Subject: [PATCH 09/16] Updating package with cleanup and updating project function --- DESCRIPTION | 16 +++++------ NAMESPACE | 27 ++++++++++--------- R/arcticdatautils.R | 8 +++--- R/eml.R | 14 +++++----- ...atautils.Rd => arcticdatautils-package.Rd} | 10 +++++-- 5 files changed, 39 insertions(+), 36 deletions(-) rename man/{arcticdatautils.Rd => arcticdatautils-package.Rd} (88%) diff --git a/DESCRIPTION b/DESCRIPTION index 9d2bb37..0a7f70f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -29,25 +29,25 @@ Imports: dplyr, digest, EML (>= 2.0), + filelock, httr, + humaniformat, jsonlite (>= 1.8.4), + lifecycle, magrittr, methods, - filelock, + pins, raster, + rdflib, + rlang, stringr, stringi, tools, uuid, xml2, - XML, - lifecycle, - rdflib, - pins, - rlang + XML Suggests: emld, - humaniformat, knitr, lubridate, ncdf4, @@ -58,7 +58,7 @@ Suggests: testthat (>= 3.0.0), xslt, yaml -RoxygenNote: 7.3.3 Roxygen: list(markdown = TRUE) VignetteBuilder: knitr Config/testthat/edition: 3 +Config/roxygen2/version: 8.1.0 diff --git a/NAMESPACE b/NAMESPACE index 4d15410..171710d 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -77,20 +77,21 @@ import(EML) import(XML) import(dataone) import(datapack) -import(raster) importFrom(httr,content) importFrom(magrittr,'%>%') -importFrom(methods,"slot<-") -importFrom(methods,as) -importFrom(methods,is) -importFrom(methods,new) -importFrom(methods,slot) +importFrom(methods, + "slot<-", + as, + is, + new, + slot +) importFrom(rlang,.data) importFrom(stats,na.omit) -importFrom(utils,URLencode) -importFrom(utils,head) -importFrom(utils,read.csv) -importFrom(utils,read.delim) -importFrom(utils,setTxtProgressBar) -importFrom(utils,tail) -importFrom(utils,txtProgressBar) +importFrom(utils, + URLencode, + read.csv, + read.delim, + setTxtProgressBar, + txtProgressBar +) diff --git a/R/arcticdatautils.R b/R/arcticdatautils.R index 0dd2de0..c21c3ae 100644 --- a/R/arcticdatautils.R +++ b/R/arcticdatautils.R @@ -3,13 +3,11 @@ #' This package contains code for doing lots of useful stuff that's too specific for the #' dataone package, primarily functions that streamline Arctic Data Center operations. #' -#' @docType package -#' @name arcticdatautils -#' #' @import dataone #' @import datapack #' @import EML #' @importFrom methods as is new slot slot<- #' @importFrom stats na.omit -#' @importFrom utils URLencode head read.csv read.delim setTxtProgressBar txtProgressBar -NULL +#' @importFrom utils URLencode read.csv read.delim setTxtProgressBar txtProgressBar +"_PACKAGE" + diff --git a/R/eml.R b/R/eml.R index ac8ac48..925b4a3 100644 --- a/R/eml.R +++ b/R/eml.R @@ -345,7 +345,6 @@ reorder_pids <- function(pid_list, doc){ #' doc$dataset$project <- proj #' #' EML::eml_validate(doc) -#' @importFrom utils tail eml_nsf_to_project <- function(awards, eml_version = "2.2"){ stopifnot(is.character(awards)) @@ -445,14 +444,14 @@ extract_name <- function(x){ email_pattern <- "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" name_without_email <- lapply(x, function(x) { split_name <- strsplit(x, split = " ")[[1]] - if (grepl(email_pattern, tail(split_name, 1))) { - split_name <- head(split_name, -1) + if (grepl(email_pattern, utils::tail(split_name, 1))) { + split_name <- utils::head(split_name, -1) } - if (grepl(c("(Former)"), tail(split_name, 1))) { - split_name <- head(split_name, -1) + if (grepl(c("(Former)"), utils::tail(split_name, 1))) { + split_name <- utils::head(split_name, -1) } - if (grepl(c("(former)"), tail(split_name, 1))) { - split_name <- head(split_name, -1) + if (grepl(c("(former)"), utils::tail(split_name, 1))) { + split_name <- utils::head(split_name, -1) } name_without_email <- paste(split_name, collapse = " ") }) @@ -495,7 +494,6 @@ extract_name <- function(x){ #' @param coord_name (char) horizCoordSysDef name #' @param attributes (dataTable) attributes for raster #' -#' @import raster #' @export eml_get_raster_metadata <- function(path, coord_name = NULL, attributes){ diff --git a/man/arcticdatautils.Rd b/man/arcticdatautils-package.Rd similarity index 88% rename from man/arcticdatautils.Rd rename to man/arcticdatautils-package.Rd index d0a4870..da3c439 100644 --- a/man/arcticdatautils.Rd +++ b/man/arcticdatautils-package.Rd @@ -1,9 +1,9 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/arcticdatautils.R \docType{package} -\name{arcticdatautils} -\alias{arcticdatautils-package} +\name{arcticdatautils-package} \alias{arcticdatautils} +\alias{arcticdatautils-package} \title{arcticdatautils: Utilities for the Arctic Data Center} \description{ This package contains code for doing lots of useful stuff that's too specific for the @@ -20,6 +20,11 @@ Useful links: \author{ \strong{Maintainer}: Bryce Mecum \email{mecum@nceas.ucsb.edu} +Authors: +\itemize{ + \item Bryce Mecum \email{mecum@nceas.ucsb.edu} +} + Other contributors: \itemize{ \item Matt Jones \email{jones@nceas.ucsb.edu} [contributor] @@ -31,6 +36,7 @@ Other contributors: \item Derek Strong \email{dstrong@nceas.ucsb.edu} [contributor] \item Rachel Sun \email{rachelsun@ucsb.edu} [contributor] \item Jasmine Lai \email{jasminelai@nceas.ucsb.edu} [contributor] + \item Justin Kadi \email{jeakadi@nceas.ucsb.edu} [contributor] } } From 38fde443f903af8b2898f53b384fb40fb23fe520 Mon Sep 17 00:00:00 2001 From: justinkadi Date: Tue, 6 Oct 2026 16:46:33 -0700 Subject: [PATCH 10/16] Removing ::: for internal function dependency --- R/util.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/util.R b/R/util.R index 33cdeae..a1ffd1b 100644 --- a/R/util.R +++ b/R/util.R @@ -1007,7 +1007,7 @@ set_public_read_all_versions <- function(mn, resource_map_pid) { stopifnot(is(mn, 'MNode')) stopifnot(is_token_set(mn)) stopifnot(is.character(resource_map_pid)) - stopifnot(arcticdatautils:::is_resource_map(mn, resource_map_pid)) + stopifnot(is_resource_map(mn, resource_map_pid)) pids <- get_package(mn, resource_map_pid) %>% unlist() From de7a0947162ce4042ee7c192fb55d9cf2f99505b Mon Sep 17 00:00:00 2001 From: justinkadi Date: Tue, 6 Oct 2026 16:49:17 -0700 Subject: [PATCH 11/16] Removing ::: in access.R --- R/access.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/access.R b/R/access.R index f4ee3bb..154b97f 100644 --- a/R/access.R +++ b/R/access.R @@ -603,10 +603,10 @@ is_public_read <- function(mn, pids, use.names = TRUE) { vapply(pids, USE.NAMES = use.names, FUN.VALUE = logical(1), FUN = function(pid) { url <- paste(mn@endpoint, "meta", utils::URLencode(pid, reserved = TRUE), sep = "/") - response <- dataone:::auth_get(url, node = mn) + response <- auth_get(url, node = mn) if (response$status_code != "200") { - error_desc <- dataone:::getErrorDescription(response) + error_desc <- getErrorDescription(response) if (grepl("READ not allowed", error_desc, ignore.case = TRUE)) { return(FALSE) } else { From 6ef021e7de7b2f068f290b8ed3d4a62a18edef19 Mon Sep 17 00:00:00 2001 From: justinkadi Date: Wed, 7 Oct 2026 12:02:34 -0700 Subject: [PATCH 12/16] Removed deprecated pin function from read_ontology --- R/ontology.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/ontology.R b/R/ontology.R index 2fcb02f..a9f7fee 100644 --- a/R/ontology.R +++ b/R/ontology.R @@ -14,12 +14,12 @@ read_ontology <- function(ontology_name) { if(ontology_name == "mosaic"){ ann_url <- "https://raw.githubusercontent.com/DataONEorg/sem-prov-ontologies/main/MOSAiC/MOSAiC.owl" - ont <- rdflib::rdf_parse(pins::pin(ann_url), + ont <- rdflib::rdf_parse(ann_url, format = "rdfxml") } else if(ontology_name == "ecso"){ ann_url <- "https://raw.githubusercontent.com/DataONEorg/sem-prov-ontologies/ECSO8-add_non-carbon_measurements/observation/ECSO8.owl" - ont <- rdflib::rdf_parse(pins::pin(ann_url), + ont <- rdflib::rdf_parse(ann_url, format = "rdfxml") } else if (ontology_name == "ADCAD"){ ann_url <- "https://data.bioontology.org/ontologies/ADCAD/download?apikey=8b5b7825-538d-40e0-9e9e-5ab9274a9aeb&download_format=rdf" From 70639484f0e00e1273a3fcd5124145aff41d692f Mon Sep 17 00:00:00 2001 From: justinkadi Date: Wed, 7 Oct 2026 12:07:05 -0700 Subject: [PATCH 13/16] Added pkg to head function because global function was undefined --- R/util.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/util.R b/R/util.R index a1ffd1b..8c51b05 100644 --- a/R/util.R +++ b/R/util.R @@ -91,7 +91,7 @@ show_random_dataset <- function(inventory, theme=NULL, n=10) { cat(paste0("Theme: ", theme, "\n")) cat(paste0("nfiles: ", length(files), "\n")) cat(paste0("Base dir: ", base_dir, "\n")) - print(head(files, n = n)) + print(utils::head(files, n = n)) if (length(files) > n) { cat(paste0("...and ", length(files) - n, " more files.\n")) } } From 80f393d8189a72473af375dd8cf56bff5b0417e3 Mon Sep 17 00:00:00 2001 From: justinkadi Date: Wed, 7 Oct 2026 12:10:36 -0700 Subject: [PATCH 14/16] Update dataone global functions issue --- R/access.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/access.R b/R/access.R index 154b97f..a7545a7 100644 --- a/R/access.R +++ b/R/access.R @@ -603,10 +603,10 @@ is_public_read <- function(mn, pids, use.names = TRUE) { vapply(pids, USE.NAMES = use.names, FUN.VALUE = logical(1), FUN = function(pid) { url <- paste(mn@endpoint, "meta", utils::URLencode(pid, reserved = TRUE), sep = "/") - response <- auth_get(url, node = mn) + response <- dataone::auth_get(url, node = mn) if (response$status_code != "200") { - error_desc <- getErrorDescription(response) + error_desc <- dataone::getErrorDescription(response) if (grepl("READ not allowed", error_desc, ignore.case = TRUE)) { return(FALSE) } else { From 2f9203920d22349e09e06dc8aa7e9ca63c342308 Mon Sep 17 00:00:00 2001 From: justinkadi Date: Wed, 7 Oct 2026 12:11:21 -0700 Subject: [PATCH 15/16] removed filelock and pins from imports because they are unsused now --- DESCRIPTION | 2 -- 1 file changed, 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0a7f70f..186df51 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -29,14 +29,12 @@ Imports: dplyr, digest, EML (>= 2.0), - filelock, httr, humaniformat, jsonlite (>= 1.8.4), lifecycle, magrittr, methods, - pins, raster, rdflib, rlang, From d6598142b0c937a613cbcf885825c450a3074b21 Mon Sep 17 00:00:00 2001 From: justinkadi Date: Wed, 7 Oct 2026 12:19:57 -0700 Subject: [PATCH 16/16] Updated it to include internal functions because of unexported objects in dataone --- R/access.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/access.R b/R/access.R index a7545a7..f4ee3bb 100644 --- a/R/access.R +++ b/R/access.R @@ -603,10 +603,10 @@ is_public_read <- function(mn, pids, use.names = TRUE) { vapply(pids, USE.NAMES = use.names, FUN.VALUE = logical(1), FUN = function(pid) { url <- paste(mn@endpoint, "meta", utils::URLencode(pid, reserved = TRUE), sep = "/") - response <- dataone::auth_get(url, node = mn) + response <- dataone:::auth_get(url, node = mn) if (response$status_code != "200") { - error_desc <- dataone::getErrorDescription(response) + error_desc <- dataone:::getErrorDescription(response) if (grepl("READ not allowed", error_desc, ignore.case = TRUE)) { return(FALSE) } else {