Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand All @@ -33,6 +34,7 @@ Imports:
magrittr,
methods,
filelock,
raster,
stringr,
stringi,
tools,
Expand All @@ -51,13 +53,12 @@ Suggests:
ncdf4,
RCurl,
purrr,
raster,
rmarkdown,
sf,
Comment on lines 55 to 57
testthat (>= 3.0.0),
xslt,
yaml
RoxygenNote: 7.2.3
RoxygenNote: 7.3.3
Roxygen: list(markdown = TRUE)
VignetteBuilder: knitr
Config/testthat/edition: 3
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ import(EML)
import(XML)
import(dataone)
import(datapack)
import(raster)
importFrom(httr,content)
importFrom(magrittr,'%>%')
importFrom(methods,"slot<-")
Expand Down
14 changes: 10 additions & 4 deletions R/eml.R
Original file line number Diff line number Diff line change
Expand Up @@ -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]],
Comment on lines 446 to +451
-1),
-1),
collapse = " ")
}))
)
})
}



#' Get raster info from a file on disk
#'
#' This function populates a spatialRaster element with the
Expand All @@ -463,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){

Expand Down
26 changes: 26 additions & 0 deletions man/arcticdatautils.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions tests/testthat/test_access.R
Original file line number Diff line number Diff line change
@@ -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", {
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_dataone.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("Helpers for the dataone package")

node <- env_load()$mn

test_that("permissions can be checked", {
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_editing.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("Editing and managing data packages")

mn <- env_load()$mn

test_that("we can publish an update", {
Expand Down
9 changes: 5 additions & 4 deletions tests/testthat/test_eml.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("EML")

mn <- env_load()$mn

test_that("a dataTable and otherEntity can be added from a pid", {
Expand Down Expand Up @@ -272,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"))))
Comment on lines +275 to +278

me <- list(individualName = list(givenName = "Jeanette", surName = "Clark"))

Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_environment.R
Original file line number Diff line number Diff line change
@@ -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"))

Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_formats.R
Original file line number Diff line number Diff line change
@@ -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"))
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_helpers.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("Helpers")

mn <- env_load()$mn

test_that("a dummy package can be created", {
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_packaging.R
Original file line number Diff line number Diff line change
@@ -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"),
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_sysmeta.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("System metadata")

test_that("the replication policy gets cleared", {
library(datapack)

Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_util.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("Utilities")

test_that("paths can be joined", {
expect_equal(path_join(""), "")
expect_equal(path_join(1), "1")
Expand Down
Loading