Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc fixes found when running package checks on newer releases of R #3237

Merged
merged 44 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
c4b0e9e
unused import
infotroph Nov 26, 2023
333cc86
fix email format
infotroph Nov 26, 2023
b793fcc
roxygen fixes
infotroph Nov 26, 2023
0da3ff3
fix long-lived typo
infotroph Nov 26, 2023
b0dd54b
roxygen fixes
infotroph Nov 27, 2023
ba17eae
man page not rendered before
infotroph Nov 27, 2023
4640bf9
Merge branch 'develop' into check-on-newer-R
infotroph Nov 30, 2023
882d431
Merge branch 'develop' into check-on-newer-R
infotroph Nov 30, 2023
1162e11
ignore contrib folder at package build time
infotroph Nov 30, 2023
806572e
delete unused shapefiles
infotroph Nov 30, 2023
dc55887
Merge branch 'develop' into check-on-newer-R
infotroph Dec 2, 2023
aa33ec8
unused import
infotroph Dec 2, 2023
8208770
depends
infotroph Dec 2, 2023
e41a4b3
install newer dbplyr
infotroph Dec 3, 2023
05db9b7
Merge branch 'develop' into check-on-newer-R
infotroph Dec 9, 2023
062eb2f
Merge branch 'develop' into check-on-newer-R
infotroph Dec 23, 2023
3dfd6fc
Merge branch 'develop' into check-on-newer-R
infotroph Jan 5, 2024
8129f42
Merge branch 'develop' into check-on-newer-R
infotroph Jan 18, 2024
aa8f4bb
run generate_dependencies.R
infotroph Jan 18, 2024
2783f0a
new dbplyr needs new dplyr
infotroph Jan 18, 2024
417a9aa
Merge branch 'develop' into check-on-newer-R
infotroph Jan 19, 2024
599dd64
Merge branch 'develop' into check-on-newer-R
infotroph Jan 30, 2024
ecf9f44
generate dependencies
infotroph Jan 30, 2024
25d9e24
Merge branch 'develop' into check-on-newer-R
mdietze Feb 13, 2024
d94cb9e
Merge branch 'develop' into check-on-newer-R
infotroph Feb 13, 2024
4c8bec7
Merge branch 'develop' into check-on-newer-R
mdietze Feb 13, 2024
c5cf812
add missing met2cf params
infotroph Feb 13, 2024
5647ae8
Merge branch 'develop' into check-on-newer-R
infotroph Feb 14, 2024
ec8f49b
Merge branch 'develop' into check-on-newer-R
infotroph Feb 14, 2024
2a33763
Merge branch 'develop' into check-on-newer-R
dlebauer Feb 15, 2024
cb37748
move ecoregion JSONs, compress BADM data
infotroph Feb 16, 2024
a9820f1
typos
infotroph Feb 16, 2024
d2ed510
move FIA_allometry folder into contrib/
infotroph Feb 16, 2024
2111b1e
document and lazy-load BADM and soil_class
infotroph Feb 16, 2024
c16d555
resaving data -> new serialization format
infotroph Feb 16, 2024
d6931de
avoid spurious check failures from timestamps
infotroph Feb 16, 2024
1cb41c8
remove timestamp for real
infotroph Feb 16, 2024
e9eea4a
quit early if no notes
infotroph Feb 17, 2024
2985b0d
strip trailing whitespace too, move to own function
infotroph Feb 17, 2024
b25b6eb
stringr not used
infotroph Feb 17, 2024
5defc42
testthat dislikes expectations outside test_that
infotroph Feb 17, 2024
e364155
priors does not use utils
infotroph Feb 17, 2024
f51ce80
RTM: pass PACKAGE argument to .Fortran
infotroph Feb 19, 2024
29b7108
Merge branch 'develop' into check-on-newer-R
infotroph Feb 21, 2024
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 Makefile.depends
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ $(call depends,modules/data.hydrology): | .install/base/logger .install/base/uti
$(call depends,modules/data.land): | .install/base/db .install/base/logger .install/base/remote .install/base/settings .install/base/utils .install/base/visualization .install/modules/benchmark .install/modules/data.atmosphere
$(call depends,modules/data.remote): | .install/base/db .install/base/logger .install/base/remote .install/base/utils
$(call depends,modules/meta.analysis): | .install/base/db .install/base/logger .install/base/settings .install/base/utils
$(call depends,modules/priors): | .install/base/logger .install/base/utils .install/base/visualization .install/modules/meta.analysis
$(call depends,modules/priors): | .install/base/logger .install/base/visualization .install/modules/meta.analysis
$(call depends,modules/rtm): | .install/base/logger .install/base/utils .install/models/ed .install/modules/assim.batch
$(call depends,modules/uncertainty): | .install/base/db .install/base/logger .install/base/settings .install/base/utils .install/modules/emulator .install/modules/priors
6 changes: 3 additions & 3 deletions base/db/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Authors@R: c(person("David", "LeBauer", role = c("aut", "cre"),
person("Chris", "Black", role = c("aut"),
email = "[email protected]"),
person("Liam", "Burke", role = c("aut"),
email = "[email protected]>"),
email = "[email protected]"),
person("Ryan", "Kelly", role = c("aut"),
email = "[email protected]"),
person("Dan", "Wang", role = c("aut")),
Expand All @@ -43,8 +43,8 @@ Description: The Predictive Ecosystem Carbon Analyzer (PEcAn) is a scientific
Imports:
curl,
DBI,
dbplyr,
dplyr,
dbplyr (>= 2.4.0),
dplyr (>= 1.1.2),
fs,
glue,
lubridate,
Expand Down
2 changes: 1 addition & 1 deletion base/db/man/PEcAn.DB-package.Rd

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

7 changes: 3 additions & 4 deletions base/remote/R/merge_job_files.R
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#' merge_job_files
#' Merge multiple job.sh files into one larger file.
#'
#' @param settings PEcAn.settings object with host section.
#' @param jobs_per_file the number of files you want to merge.
#' @param outdir output directory of merged job files.
#'
#' @return
#' @return vector of the newly created filenames
#' @export
#' @author Dongchen Zhang
#'
#' @examples
merge_job_files <- function(settings, jobs_per_file = 10, outdir = NULL){
# default outdir
if(is.null(outdir)){
Expand Down Expand Up @@ -39,4 +38,4 @@ merge_job_files <- function(settings, jobs_per_file = 10, outdir = NULL){
i <- i + jobs_per_file
}
files
}
}
7 changes: 4 additions & 3 deletions base/remote/man/merge_job_files.Rd

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

2 changes: 1 addition & 1 deletion base/utils/R/mcmc.list2init.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ mcmc.list2init <- function(dat) {

## define variables
ic <- list()
n <- nrow(dat[[1]])
nr <- nrow(dat[[1]])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

surprised this was not found earlier.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me too! It looks like the typo ought to make this function return all samples instead of just the last ones, which seems like it ought to be pretty obvious. And yet...!

nc <- coda::nchain(dat)
for(c in seq_len(nc)) ic[[c]] <- list()

Expand Down
6 changes: 2 additions & 4 deletions docker/depends/pecan_package_dependencies.csv
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,13 @@
"DBI","*","base/db","Imports",FALSE
"DBI","*","modules/assim.sequential","Suggests",FALSE
"DBI","*","modules/data.remote","Imports",FALSE
"dbplyr","*","base/db","Imports",FALSE
"dbplyr","*","modules/benchmark","Imports",FALSE
"dbplyr",">= 2.4.0","base/db","Imports",FALSE
"devtools","*","models/ed","Suggests",FALSE
"doParallel","*","modules/data.atmosphere","Suggests",FALSE
"doParallel","*","modules/data.remote","Imports",FALSE
"doSNOW","*","base/remote","Suggests",FALSE
"dplR","*","modules/data.land","Imports",FALSE
"dplyr","*","base/db","Imports",FALSE
"dplyr","*","base/qaqc","Imports",FALSE
"dplyr","*","base/remote","Imports",FALSE
"dplyr","*","base/utils","Imports",FALSE
Expand All @@ -62,6 +61,7 @@
"dplyr","*","modules/data.land","Imports",FALSE
"dplyr","*","modules/data.remote","Suggests",FALSE
"dplyr","*","modules/uncertainty","Imports",FALSE
"dplyr",">= 1.1.2","base/db","Imports",FALSE
"ellipse","*","modules/assim.batch","Imports",FALSE
"emdbook","*","modules/assim.sequential","Suggests",FALSE
"foreach","*","base/remote","Imports",FALSE
Expand Down Expand Up @@ -401,7 +401,6 @@
"PEcAn.utils","*","modules/data.land","Imports",TRUE
"PEcAn.utils","*","modules/data.remote","Imports",TRUE
"PEcAn.utils","*","modules/meta.analysis","Imports",TRUE
"PEcAn.utils","*","modules/priors","Imports",TRUE
"PEcAn.utils","*","modules/rtm","Suggests",TRUE
"PEcAn.utils","*","modules/uncertainty","Imports",TRUE
"PEcAn.utils",">= 1.4.8","models/basgra","Imports",TRUE
Expand Down Expand Up @@ -551,7 +550,6 @@
"stringr",">= 1.1.0","base/visualization","Imports",FALSE
"stringr",">= 1.1.0","models/ed","Imports",FALSE
"stringr",">= 1.1.0","modules/data.atmosphere","Imports",FALSE
"stringr",">= 1.1.0","modules/data.remote","Imports",FALSE
"suntools","*","modules/data.atmosphere","Imports",FALSE
"swfscMisc","*","modules/data.land","Imports",FALSE
"terra","*","modules/data.atmosphere","Imports",FALSE
Expand Down
2 changes: 1 addition & 1 deletion models/ed/R/other.helpers.ED2.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' @title List only files in a directory
#' List only files in a directory
#'
#' Mostly useful when `recursive` and `full.names` are both FALSE:
#' The current implementation sets `full.names` internally, and for recursive
Expand Down
8 changes: 1 addition & 7 deletions models/ed/man/list.files.nodir.Rd

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

5 changes: 1 addition & 4 deletions models/sipnet/R/veg2model.SIPNET.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#' veg2model.SIPNET
#' @name veg2model.SIPNET
#' @title veg2model.SIPNET
#'
#' veg2model.SIPNET
#'
#' @param outfolder location to store ncdf files
#' @param poolinfo object passed from write_ic contains output from cohort2pool function
Expand Down
1 change: 0 additions & 1 deletion modules/data.atmosphere/R/ERA5_met_process.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#' @author Dongchen Zhang
#' @importFrom magrittr %>%
#'
#' @examples
ERA5_met_process <- function(settings, in.path, out.path, write.db=FALSE, write = TRUE){
#Initialize the multicore computation.
if (future::supportsMulticore()) {
Expand Down
6 changes: 2 additions & 4 deletions modules/data.atmosphere/R/download.FACE.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
##' Download Raw FACE data from the internet
##'
##' @name download.FACE
##' @title download.FACE
##' @export
##'
##' @param sitename sitename
##' @param outfolder location where output is stored
Expand All @@ -12,8 +9,9 @@
##' @param end_date desired end date YYYY-MM-DD
##' @param overwrite overwrite existing files? Default is FALSE
##' @param ... other inputs
##'
##'
##' @author Betsy Cowdery
##' @export
download.FACE <- function(sitename, outfolder, start_date, end_date, overwrite = FALSE, method, ...) {
# download.FACE <-
# function(data.set,outfolder,pkg,raw.host,start_year,end_year,site.id,dbparams,con){
Expand Down
1 change: 0 additions & 1 deletion modules/data.atmosphere/R/half_hour_downscale.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#'
#' @export
#'
#' @examples
temporal_downscale_half_hour <- function(input_file, output_file, overwrite = TRUE, hr = 0.5){

# open netcdf
Expand Down
18 changes: 8 additions & 10 deletions modules/data.atmosphere/R/met.process.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
##' @name met.process
##' @title met.process
##'
##' met.process
##'
##' @param site Site info from settings file
##' @param input_met Which data source to process.
Expand Down Expand Up @@ -556,19 +554,19 @@ browndog.met <- function(browndog, source, site, start_date, end_date, model, di

#################################################################################################################################

##' @name site_from_tag
##' @title site_from_tag
##' @export
##' @param sitename
##' @param tag
##' @author Betsy Cowdery
##'
##' Function to find the site code for a specific tag
##'
##' Example:
##' sitename = 'Rhinelander Aspen FACE Experiment (FACE-RHIN)'
##' tag = 'FACE'
##' site_from_tag(sitename,tag) = 'RHIN'
##' Requires that site names be set up specifically with (tag-sitecode) - this may change
##'
##' @param sitename full name of site
##' @param tag abbreviated name of site
##' @author Betsy Cowdery
##'
##' @export
site_from_tag <- function(sitename, tag) {
temp <- regmatches(sitename, gregexpr("(?<=\\().*?(?=\\))", sitename, perl = TRUE))[[1]]
pref <- paste0(tag, "-")
Expand Down
7 changes: 3 additions & 4 deletions modules/data.atmosphere/R/met.process.stage.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
##' @name met.process.stage
##' @title met.process.stage
##' met.process.stage
##' @export
##'
##' @param input.id
##' @param raw.id
##' @param input.id bety db for input format
##' @param raw.id format id for the raw met data
##' @param con database connection
##'
##' @author Elizabeth Cowdery
Expand Down
30 changes: 22 additions & 8 deletions modules/data.atmosphere/R/met2CF.FACE.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
##' convert FACE files to CF files
##' @export
##'
##' @param in.path
##' @param in.prefix
##' @param outfolder
##' @author Elizabeth Cowdery

#' convert FACE files to CF files
#'
#' Note: `in.path` and `in.prefix` together must identify exactly one file,
#' or this function returns NULL.
#' Further note that despite its name, `in.prefix` will match anywhere in
#' the filename: met2CF.FACE("dir", "a", ...)` will find both `dir/a_b.nc`
#' and `dir/b_a.nc`!
#'
#' @param in.path directory in which to find inputs (as `*.nc`)
#' @param in.prefix pattern to match to select a file within `in.path`
#'
#' @param outfolder path to write output.
#' Should contain the substring "FACE", which will be rewritten to "FACE_a" and "FACE_e"
#' for the corresponding treatments.
#' @param start_date,end_date ignored. Time is taken from the input files.
#' @param input.id ignored
#' @param site list[like]. Only components `lat` and `lon` (both in decimal degrees) are currently used
#' @param format specification of variable names and units in the format returned by `PEcAn.DB::query.format.vars`
#' @param ... other arguments, currently ignored
#' @author Elizabeth Cowdery
#'
#' @export
met2CF.FACE <- function(in.path,in.prefix,outfolder,start_date,end_date,input.id,site,format, ...) {

files <- dir(in.path, in.prefix)
Expand Down
12 changes: 6 additions & 6 deletions modules/data.atmosphere/R/met2CF.NARR.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
##' Convert NARR files to CF files
##' @name met2CF.NARR
##' @title met2CF.NARR
##' @export
##'
##' @param in.path
##' @param in.prefix
##' @param outfolder
##' @param in.path directory in which to find NARR files
##' @param in.prefix pattern to match to find NARR files inside `in.path`
##' @param outfolder directory name to write CF outputs
##' @param start_date the start date of the data to be downloaded (will only use the year part of the date)
##' @param end_date the end date of the data to be downloaded (will only use the year part of the date)
##' @param overwrite should existing files be overwritten
##' @param verbose should ouput of function be extra verbose
##' @param ... other arguments, currently ignored
##'
##' @author Elizabeth Cowdery, Rob Kooper
##' @export
met2CF.NARR <- function(in.path, in.prefix, outfolder, start_date, end_date,
overwrite = FALSE, verbose = FALSE, ...) {

Expand Down
Loading
Loading