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 21 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
4 changes: 2 additions & 2 deletions Makefile.depends
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $(call depends,base/qaqc): | .install/base/db .install/base/logger .install/base
$(call depends,base/remote): | .install/base/logger
$(call depends,base/settings): | .install/base/db .install/base/logger .install/base/remote .install/base/utils
$(call depends,base/utils): | .install/base/logger
$(call depends,base/visualization): | .install/base/db .install/base/logger .install/base/utils
$(call depends,base/visualization): | .install/base/logger
$(call depends,base/workflow): | .install/base/db .install/base/logger .install/base/remote .install/base/settings .install/base/utils .install/modules/data.atmosphere .install/modules/data.land .install/modules/uncertainty
$(call depends,models/basgra): | .install/base/logger .install/base/utils .install/modules/data.atmosphere
$(call depends,models/biocro): | .install/base/db .install/base/logger .install/base/remote .install/base/settings .install/base/utils .install/modules/data.atmosphere .install/modules/data.land
Expand All @@ -17,7 +17,7 @@ $(call depends,models/ed): | .install/base/logger .install/base/remote .install/
$(call depends,models/fates): | .install/base/logger .install/base/remote .install/base/utils
$(call depends,models/gday): | .install/base/logger .install/base/remote .install/base/utils
$(call depends,models/jules): | .install/base/logger .install/base/remote .install/base/utils .install/modules/data.atmosphere
$(call depends,models/ldndc): | .install/base/db .install/base/logger .install/base/remote .install/base/utils .install/modules/data.atmosphere
$(call depends,models/ldndc): | .install/base/logger .install/base/remote .install/base/utils .install/modules/data.atmosphere
$(call depends,models/linkages): | .install/base/logger .install/base/remote .install/base/utils .install/modules/data.atmosphere
$(call depends,models/lpjguess): | .install/base/logger .install/base/remote .install/base/utils
$(call depends,models/maat): | .install/base/logger .install/base/remote .install/base/settings .install/base/utils .install/modules/data.atmosphere
Expand Down
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
3 changes: 0 additions & 3 deletions base/visualization/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,8 @@ Description: The Predictive Ecosystem Carbon Analyzer (PEcAn) is a scientific
Imports:
data.table,
ggplot2,
maps,
ncdf4 (>= 1.15),
PEcAn.DB,
PEcAn.logger,
PEcAn.utils,
plyr (>= 1.8.4),
reshape2,
rlang,
Expand Down
5 changes: 2 additions & 3 deletions docker/depends/pecan.depends.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,10 @@ wanted <- c(
'dataone',
'datapack',
'DBI',
'dbplyr',
'devtools',
'doParallel',
'doSNOW',
'dplR',
'dplyr',
'ellipse',
'emdbook',
'foreach',
Expand Down Expand Up @@ -68,7 +66,6 @@ wanted <- c(
'lqmm',
'Maeswrap',
'magrittr',
'maps',
'markdown',
'MASS',
'Matrix',
Expand Down Expand Up @@ -154,6 +151,8 @@ ensure_version <- function(pkg, version) {
}
ensure_version('abind', '>= 1.4.5')
ensure_version('coda', '>= 0.18')
ensure_version('dbplyr', '>= 2.4.0')
ensure_version('dplyr', '>= 1.1.2')
ensure_version('geonames', '> 0.998')
ensure_version('lubridate', '>= 1.7.0')
ensure_version('magic', '>= 1.5.0')
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.

1 change: 0 additions & 1 deletion models/ldndc/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Authors@R: c(person("Henri", "Kajasilta", role = c("aut", "cre"),
email = "[email protected]"))
Description: This module provides functions to link the (LDNDC) to PEcAn.
Imports:
PEcAn.DB,
PEcAn.logger,
PEcAn.utils (>= 1.4.8),
dplyr,
Expand Down
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 @@ -8,7 +8,6 @@
#' @return if Write is True then return input IDs with physical paths; if Write is False then return just physical paths of extracted ERA5 clim files.
#' @export
#'
#' @examples
ERA5_met_process <- function(settings, in.path, out.path, Write=FALSE){
#getting site info
#getting site ID
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
6 changes: 3 additions & 3 deletions modules/data.atmosphere/R/met2CF.FACE.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
##' convert FACE files to CF files
##' @export
##'
##' @param in.path
##' @param in.prefix
##' @param outfolder
##' @param in.path directory in which to find FACE files
##' @param in.prefix pattern to match to find FACE files inside `in.path`
##' @param outfolder directory name to write CF outputs
##' @author Elizabeth Cowdery

met2CF.FACE <- function(in.path,in.prefix,outfolder,start_date,end_date,input.id,site,format, ...) {
Expand Down
8 changes: 3 additions & 5 deletions modules/data.atmosphere/R/met2CF.NARR.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
##' 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
Expand Down
6 changes: 3 additions & 3 deletions modules/data.atmosphere/R/met2CF.csv.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
##' @title met2CF.csv
##' @export
##'
##' @param in.path
##' @param in.prefix
##' @param outfolder
##' @param in.path directory in which to find met csv files
##' @param in.prefix pattern to match to find met files inside `in.path`
##' @param outfolder directory name to write CF outputs
##' @param format data frame or list with elements as described below
##' format is output from db/R/query.format.vars, and should have:
##' REQUIRED:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ substrRight <- function(x, n) {
substr(x, nchar(x) - n + 1, nchar(x))
}

##' met_temporal_downscale.Gaussian_ensemble takes source data and a training dataset from the same site and temporally
##' met_temporal_downscale.Gaussian_ensemble
##'
##' takes source data and a training dataset from the same site and temporally
##' downscales the source dataset to the resolution of the training dataset based on statistics of the training dataset.
##' @name met_temporal_downscale.Gaussian_ensemble
##' @title met_temporal_downscale.Gaussian_ensemble
##'
##' @export
##' @param in.path
##' @param in.prefix
##' @param in.path ignored
##' @param in.prefix ignored
##' @param outfolder path to directory in which to store output. Will be created if it does not exist
##' @param input_met - the source dataset that will temporally downscaled by the train_met dataset
##' @param train_met - the observed dataset that will be used to train the modeled dataset in NC format. i.e. Flux Tower dataset
##' (see download.Fluxnet2015 or download.Ameriflux)
##' @param site.id
##' @param overwrite logical: replace output file if it already exists?
##' @param verbose logical: should \code{\link[ncdf4:ncdf4-package]{ncdf4}} functions
##' print debugging information as they run?
Expand Down
6 changes: 2 additions & 4 deletions modules/data.atmosphere/R/site.lst.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
##' Find time zone for a site
##'
##' @name site.lst
##' @title site.lst
##' @export
##' @param site.id
##' @param con
##' @param site.id bety id of site to look up
##' @param con betydb connection object
##' @author Betsy Cowdery
site.lst <- function(site.id, con) {
time.zone <- PEcAn.DB::db.query(paste("SELECT time_zone from SITES where id =", site.id), con)
Expand Down
7 changes: 3 additions & 4 deletions modules/data.atmosphere/R/temporal.downscaling.R
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,9 @@ cfmet.downscale.daily <- function(dailymet, output.dt = 1, lat) {
##' with CF-compliant variable names
##'
##' @title Get time series vector from netCDF file
##' @param var
##' @param lati
##' @param loni
##' @param run.dates
##' @param var name of variable to extract
##' @param lati,loni latitude and longitude to extract
##' @param run.dates data.table of dates to read
##' @param met.nc netcdf file with CF variable names
##' @return numeric vector
##' @export
Expand Down
6 changes: 6 additions & 0 deletions modules/data.atmosphere/man/get.ncvector.Rd

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

4 changes: 4 additions & 0 deletions modules/data.atmosphere/man/met.process.stage.Rd

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

7 changes: 7 additions & 0 deletions modules/data.atmosphere/man/met2CF.FACE.Rd

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

Loading
Loading