Skip to content

Commit

Permalink
Merge pull request #134 from isoverse/dev
Browse files Browse the repository at this point in the history
update to 1.2.6
  • Loading branch information
sebkopf committed Oct 20, 2020
2 parents 23a11df + acf6b49 commit 13886c5
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 15 deletions.
4 changes: 3 additions & 1 deletion .Rbuildignore
Expand Up @@ -22,4 +22,6 @@
^[^/]*\.rds$
^\.github$
^cran-comments.md$
^tests/testthat/test_data/.*
^tests/testthat/test_data/.*
^CRAN-RELEASE$
^Meta$
2 changes: 1 addition & 1 deletion DESCRIPTION
@@ -1,7 +1,7 @@
Package: isoreader
Title: Read Stable Isotope Data Files
Description: Interface to the raw data file formats commonly encountered in scientific disciplines that make use of stable isotopes.
Version: 1.2.5
Version: 1.2.6
Authors@R: person("Sebastian", "Kopf", email = "sebastian.kopf@colorado.edu", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-2044-0201"))
URL: https://github.com/isoverse/isoreader
BugReports: https://github.com/isoverse/isoreader/issues
Expand Down
14 changes: 1 addition & 13 deletions R/nse.R
Expand Up @@ -155,24 +155,12 @@ eval_select_pos_to_cols <- function(pos, data) {
return(cols)
}

# note: uses tidyselect:eval_select because vars_select is in questioning stage
# note: force local scope to avoid conflicts with variables in the global environment
# force local evaluation of tidyselect::eval_select
local_eval_select <- local(function(expr, data, ...) {
tidyselect::eval_select(expr, data = data, ...)
}, as.environment(2))

# force local evaluation of tidyselect::eval_rename
local_eval_rename <- local(function(expr, data, ...) {
tidyselect::eval_rename(expr, data = data, ...)
}, as.environment(2))

# safe local evaluation of tidyselect::eval_select
# note: don't use purrr::safely as it invalidates the local scope!
# @return list(return = value, error = NULL) if successful or list(return = NULL, error = character) if failed
safe_local_eval_select <- function(expr, data, ...) {
# try catch find positions
pos <- tryCatch(local_eval_select(expr, data, ...), error = conditionMessage)
pos <- tryCatch(tidyselect::eval_select(expr, data, env = as.environment(2), ...), error = conditionMessage)
if (is.integer(pos))
return(list(result = pos, error = NULL))
else
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-continuous-flow.R
Expand Up @@ -20,6 +20,9 @@ test_that("test that parameter checks are performed", {

test_that("test that dxf files can be read", {

# skip on CRAN to reduce checktime to below 10 minutes
skip_on_cran()

# check if tests are enabled
run_file_tests <- getOption("isoreader.run_file_tests")
if (!is.null(run_file_tests) && identical(run_file_tests, FALSE)) {
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-dual-inlet.R
Expand Up @@ -30,6 +30,8 @@ test_that("test that nu file processor works properly", {

test_that("test that did files can be read", {

# skip on CRAN to reduce checktime to below 10 minutes
skip_on_cran()

# check if tests are enabled
run_file_tests <- getOption("isoreader.run_file_tests")
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-export.R
@@ -1,5 +1,8 @@
context("Export functions")

# skip on CRAN to reduce checktime to below 10 minutes
skip_on_cran()

di_example <- iso_read_dual_inlet(iso_get_reader_example("dual_inlet_example.did"))
cf_example <- iso_read_continuous_flow(iso_get_reader_example("continuous_flow_example.cf"))
cf_err_example <- suppressWarnings(iso_read_continuous_flow(system.file("errdata", "cf_without_data.dxf", package = "isoreader")))
Expand Down
9 changes: 9 additions & 0 deletions tests/testthat/test-isoread.R
Expand Up @@ -41,6 +41,9 @@ test_that("test that parameter checks are performed when reading file", {

test_that("test that cached file path hashes work okay", {

# skip on CRAN to reduce checktime to below 10 minutes
skip_on_cran()

data_folder <- "minimal_data" # data_folder <- file.path("tests", "testthat", "minimal_data") # for direct testing
origin_file <- get_isoreader_test_file("minimal_01.did", data_folder)

Expand Down Expand Up @@ -81,6 +84,9 @@ test_that("test that cached file path hashes work okay", {

test_that("test that version checking and re-reads are working properly", {

# skip on CRAN to reduce checktime to below 10 minutes
skip_on_cran()

# test folder
data_folder <- "minimal_data" # data_folder <- file.path("tests", "testthat", "minimal_data") # for direct testing
test_files <- c(
Expand Down Expand Up @@ -221,6 +227,9 @@ test_that("test that version checking and re-reads are working properly", {

test_that("test that file event expressions work", {

# skip on CRAN to reduce checktime to below 10 minutes
skip_on_cran()

data_folder <- file.path("minimal_data")
minimal_files <- c(
get_isoreader_test_file("minimal_01.did", local_folder = data_folder),
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-scan.R
Expand Up @@ -19,6 +19,9 @@ test_that("test that parameter checks are performed", {

test_that("test that scn files can be read", {

# skip on CRAN to reduce checktime to below 10 minutes
skip_on_cran()

# check if tests are enabled
run_file_tests <- getOption("isoreader.run_file_tests")
if (!is.null(run_file_tests) && identical(run_file_tests, FALSE)) {
Expand Down

0 comments on commit 13886c5

Please sign in to comment.