diff --git a/Makefile.depends b/Makefile.depends index 9c1791564d6..9382034864c 100644 --- a/Makefile.depends +++ b/Makefile.depends @@ -28,7 +28,7 @@ $(call depends,models/cable): | .install/base/logger .install/base/utils $(call depends,models/clm45): | .install/base/logger .install/base/utils $(call depends,models/dalec): | .install/base/logger .install/base/remote .install/base/utils $(call depends,models/dvmdostem): | .install/base/logger .install/base/utils -$(call depends,models/ed): | .install/modules/data.atmosphere .install/modules/data.land .install/base/logger .install/base/remote .install/base/settings .install/base/utils +$(call depends,models/ed): | .install/modules/data.atmosphere .install/modules/data.land .install/base/db .install/base/logger .install/base/remote .install/base/settings .install/base/utils $(call depends,models/fates): | .install/base/logger .install/base/remote .install/base/utils $(call depends,models/gday): | .install/base/utils .install/base/logger .install/base/remote $(call depends,models/jules): | .install/modules/data.atmosphere .install/base/logger .install/base/remote .install/base/utils diff --git a/models/ed/.Rbuildignore b/models/ed/.Rbuildignore index cd7512dad26..f6123f26e2b 100644 --- a/models/ed/.Rbuildignore +++ b/models/ed/.Rbuildignore @@ -4,3 +4,4 @@ ^data-raw$ ^.*\.Rproj$ ^\.Rproj\.user$ +vignettes/ed_run_data/ diff --git a/models/ed/DESCRIPTION b/models/ed/DESCRIPTION index e8bc9bcc3d2..311dc1d2abf 100644 --- a/models/ed/DESCRIPTION +++ b/models/ed/DESCRIPTION @@ -44,6 +44,7 @@ Imports: ncdf4 (>= 1.15), PEcAn.data.atmosphere, PEcAn.data.land, + PEcAn.DB, PEcAn.logger, PEcAn.remote, PEcAn.settings, diff --git a/models/ed/R/create_veg.R b/models/ed/R/create_veg.R index fc62d09434d..ea8d434484f 100644 --- a/models/ed/R/create_veg.R +++ b/models/ed/R/create_veg.R @@ -70,6 +70,6 @@ create_site <- function(input, check = TRUE) { #' @return Modified `data.frame` modify_df <- function(input, base) { col_names <- colnames(base) - out_list <- modifyList(as.list(base), as.list(input)) + out_list <- utils::modifyList(as.list(base), as.list(input)) as.data.frame(out_list)[col_names] } diff --git a/models/ed/R/download_edi.R b/models/ed/R/download_edi.R index 490d91ff530..8559a25541f 100644 --- a/models/ed/R/download_edi.R +++ b/models/ed/R/download_edi.R @@ -14,6 +14,6 @@ download_edi <- function(directory) { download_link <- "https://files.osf.io/v1/resources/b6umf/providers/osfstorage/5a948ea691b689000fa2a588/?zip=" target_file <- paste0(directory, ".zip") PEcAn.utils::download_file(download_link, target_file) - unzip(target_file, exdir = directory) + utils::unzip(target_file, exdir = directory) invisible(TRUE) } diff --git a/models/ed/R/ed_varlookup.R b/models/ed/R/ed_varlookup.R index 0f80aeb0718..7ac2c596d95 100644 --- a/models/ed/R/ed_varlookup.R +++ b/models/ed/R/ed_varlookup.R @@ -1,5 +1,6 @@ #' Lookup function for translating commonly used ED variables #' returns out list, readvar variables to read from file, expr if any derivation is needed +#' @param varname character; variable name to read from file #' @export ed.var <- function(varname) { if(varname == "AGB") { diff --git a/models/ed/R/met2model.ED2.R b/models/ed/R/met2model.ED2.R index b9d57c4f2b2..70dfa5cd623 100644 --- a/models/ed/R/met2model.ED2.R +++ b/models/ed/R/met2model.ED2.R @@ -21,9 +21,12 @@ #' @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 lst timezone offset to GMT in hours +#' @param lat latitude; if not provide the function will attempt to discover it in input files +#' @param lon longitude; if not provide the function will attempt to discover it in input files #' @param overwrite should existing files be overwritten #' @param verbose should the function be very verbose #' @param leap_year Enforce Leap-years? If set to TRUE, will require leap years to have 366 days. If set to false, will require all years to have 365 days. Default = TRUE. +#' @param ... currently unused met2model.ED2 <- function(in.path, in.prefix, outfolder, start_date, end_date, lst = 0, lat = NA, lon = NA, overwrite = FALSE, verbose = FALSE, leap_year = TRUE, ...) { diff --git a/models/ed/R/model2netcdf.ED2.R b/models/ed/R/model2netcdf.ED2.R index 30aea2a1cf9..fd577de519f 100644 --- a/models/ed/R/model2netcdf.ED2.R +++ b/models/ed/R/model2netcdf.ED2.R @@ -783,7 +783,7 @@ put_T_values <- model_timestep_s <- length(output_date_vector) / length(out[[1]]) iter_per_day <- round(1 / model_timestep_s) ## e.g. 48 ## Create a timesteps vector (e.g. 0.00000000 0.02083333 0.04166667 0.06250000 0.08333333 0.10416667 ...) - timesteps <- head(seq(0, 1, by = 1 / iter_per_day), -1) + timesteps <- utils::head(seq(0, 1, by = 1 / iter_per_day), -1) ## Create a new date vector where each day is repeated by iter_per_day ## (e.g. "2001-07-15" "2001-07-15" "2001-07-15" "2001-07-15" "2001-07-15" ...) sub_dates <- rep(output_date_vector, each = iter_per_day) diff --git a/models/ed/R/modify_ed2in.R b/models/ed/R/modify_ed2in.R index 06b9907d16a..3cd6a4549f7 100644 --- a/models/ed/R/modify_ed2in.R +++ b/models/ed/R/modify_ed2in.R @@ -89,7 +89,7 @@ modify_ed2in <- function(ed2in, ..., if (is.null(.dots)) { .dots <- list() } - dots <- modifyList(.dots, list(...)) + dots <- utils::modifyList(.dots, list(...)) is_upper <- names(dots) == toupper(names(dots)) lower_args <- names(dots)[!is_upper] if (length(lower_args) > 0) { @@ -211,7 +211,7 @@ modify_ed2in <- function(ed2in, ..., # 3 for HDF5 output, 0 for no output on_types <- (valid_types %in% output_types) * 3 names(on_types) <- names(valid_types) - ed2in <- modifyList(ed2in, as.list(on_types)) + ed2in <- utils::modifyList(ed2in, as.list(on_types)) } if (!is.null(output_dir)) { @@ -249,6 +249,6 @@ modify_ed2in <- function(ed2in, ..., ) } } - ed2in <- modifyList(ed2in, namelist_args) + ed2in <- utils::modifyList(ed2in, namelist_args) ed2in } diff --git a/models/ed/R/other.helpers.ED2.R b/models/ed/R/other.helpers.ED2.R index e04a62d43ed..652c4eb8edc 100644 --- a/models/ed/R/other.helpers.ED2.R +++ b/models/ed/R/other.helpers.ED2.R @@ -17,8 +17,11 @@ list.files.nodir <- function(path, ...) { #' Function translating pecan vars to ED vars +#' @param varnames character; variable names to translate +#' @export +#' @examples #' var.names <- c("DBH", "AGB", "AbvGrndWood") -#' @export +#' translate_vars_ed(var.names) translate_vars_ed <- function(varnames) { var.list <- add.list <- list() diff --git a/models/ed/R/read_ed_metheader.R b/models/ed/R/read_ed_metheader.R index 76522174354..cdc60eafe29 100644 --- a/models/ed/R/read_ed_metheader.R +++ b/models/ed/R/read_ed_metheader.R @@ -83,10 +83,10 @@ read_ed_metheader <- function(filename, check = TRUE, check_files = TRUE) { PEcAn.logger::logger.warn(msg) } } - metadata <- unlist(read.table(text = sub_file[2])) + metadata <- unlist(utils::read.table(text = sub_file[2])) names(metadata) <- c("nlon", "nlat", "dx", "dy", "xmin", "ymin") nvars <- as.numeric(sub_file[3]) - variables_raw <- read.table(text = sub_file[4:6], header = TRUE) + variables_raw <- utils::read.table(text = sub_file[4:6], header = TRUE) variables_raw$value_type <- c("update_frequency", "flag") variables_table <- variables_raw %>% tidyr::gather("variable", "value", -.data$value_type) %>% diff --git a/models/ed/R/read_ed_veg.R b/models/ed/R/read_ed_veg.R index 56e9df2ade5..bea75ec29ea 100644 --- a/models/ed/R/read_ed_veg.R +++ b/models/ed/R/read_ed_veg.R @@ -93,7 +93,7 @@ get_latlon <- function(filepath, latlon) { #' @return `data.frame` containing #' @export read_css <- function(filepath, check = TRUE, ...) { - css <- read.table(filepath, header = TRUE) + css <- utils::read.table(filepath, header = TRUE) if (check) { check_css(css, ...) } @@ -103,7 +103,7 @@ read_css <- function(filepath, check = TRUE, ...) { #' @rdname read_css #' @export read_pss <- function(filepath, check = TRUE) { - pss <- read.table(filepath, header = TRUE) + pss <- utils::read.table(filepath, header = TRUE) if (check) { check_pss(pss) } @@ -116,7 +116,7 @@ read_site <- function(filepath, check = TRUE, ...) { top_line <- readLines(filepath, n = 1) nsite <- as.numeric(gsub(".*nsite +([[:digit:]]+).*", "\\1", top_line)) file_format <- as.numeric(gsub(".*file_format +([[:digit:]]+).*", "\\1", top_line)) - site <- read.table(filepath, header = TRUE, skip = 1) + site <- utils::read.table(filepath, header = TRUE, skip = 1) attr(site, "nsite") <- nsite attr(site, "file_format") <- file_format if (check) { diff --git a/models/ed/R/read_restart.ED2.R b/models/ed/R/read_restart.ED2.R index eb5f55c1900..f9fc9b18dba 100644 --- a/models/ed/R/read_restart.ED2.R +++ b/models/ed/R/read_restart.ED2.R @@ -1,7 +1,12 @@ #' @title State data assimilation read-restart for ED2 #' #' @author Alexey Shiklomanov, Istem Fer -#' @inheritParams PEcAn.ModelName::read_restart.ModelName +#' @param outdir Output directory +#' @param runid Run ID +#' @param stop.time Year that is being read +#' @param settings PEcAn settings object +#' @param var.names Variable names to be extracted +#' @param params Any parameters required for state calculations #' @examples #' \dontrun{ #' outdir <- "~/sda-hackathon/outputs" diff --git a/models/ed/R/run_ed_singularity.R b/models/ed/R/run_ed_singularity.R index 56c33fe643a..74b69388554 100644 --- a/models/ed/R/run_ed_singularity.R +++ b/models/ed/R/run_ed_singularity.R @@ -21,7 +21,7 @@ #' @param ed2in_path Path to ED2IN file. #' @param app Singularity "app" to run. Either "ED" or "EDR". #' @param singularity_args Additional arguments to be passed to `singularity run` (before) -#' @param Additional arguments to [base::system2] +#' @param ... Additional arguments to [base::system2] #' @export run_ed_singularity <- function(img_path, ed2in_path, app = "ED", diff --git a/models/ed/R/veg2model.ED2.R b/models/ed/R/veg2model.ED2.R index 7eea835ae41..ac7e23d9ba5 100644 --- a/models/ed/R/veg2model.ED2.R +++ b/models/ed/R/veg2model.ED2.R @@ -163,7 +163,7 @@ veg2model.ED2 <- function(outfolder, veg_info, start_date, new_site, source, ens css$time[is.na(css$time)] <- start_year css$cohort[is.na(css$cohort)] <- 1:sum(is.na(css$cohort)) css$dbh[is.na(css$dbh)] <- 1 # assign nominal small dbh to missing - density.median <- median(css$n[which(css$n > 0)]) + density.median <- stats::median(css$n[which(css$n > 0)]) css$n[is.na(css$n) | css$n == 0] <- density.median css$hite <- css$bdead <- css$balive <- css$lai <- 0 @@ -177,10 +177,10 @@ veg2model.ED2 <- function(outfolder, veg_info, start_date, new_site, source, ens # Write files # css - write.table(css, filenames_full[1], quote = FALSE, row.names = FALSE) + utils::write.table(css, filenames_full[1], quote = FALSE, row.names = FALSE) # pss - write.table(pss, filenames_full[2], quote = FALSE, row.names = FALSE) + utils::write.table(pss, filenames_full[2], quote = FALSE, row.names = FALSE) # site # hardcoded per fia2ED implemention diff --git a/models/ed/R/write.configs.ed.R b/models/ed/R/write.configs.ed.R index 104cdd4f2de..d7303f9a6a1 100644 --- a/models/ed/R/write.configs.ed.R +++ b/models/ed/R/write.configs.ed.R @@ -137,7 +137,7 @@ write.config.ED2 <- function(trait.values, settings, run.id, defaults = settings ## Edit ED2IN file for runs revision <- settings$model$revision if (is.null(revision)) { - model <- db.query(paste("SELECT * FROM models WHERE id =", settings$model$id), params = settings$database$bety) + model <- PEcAn.DB::db.query(paste("SELECT * FROM models WHERE id =", settings$model$id), params = settings$database$bety) revision <- model$revision } revision <- gsub("^r", "", revision) @@ -255,7 +255,7 @@ write.config.ED2 <- function(trait.values, settings, run.id, defaults = settings # Overwrite defaults with values from settings$model$ed2in_tags list if(!is.null(settings$model$ed2in_tags)){ - sda_tags <- modifyList(sda_tags, settings$model$ed2in_tags[names(sda_tags)]) + sda_tags <- utils::modifyList(sda_tags, settings$model$ed2in_tags[names(sda_tags)]) } ed2in.text <- modify_ed2in(ed2in.text, .dots = sda_tags, add_if_missing = TRUE, check_paths = check) } @@ -520,12 +520,12 @@ write.config.xml.ED2 <- function(settings, trait.values, defaults = settings$con } if (grepl("soil", pft)) { - data(soil, package = "PEcAn.ED2", envir = environment()) + utils::data(soil, package = "PEcAn.ED2", envir = environment()) vals <- as.list(soil) names(vals) <- colnames(soil) converted.trait.values <- convert.samples.ED(trait.values[[i]]) - vals <- modifyList(vals, converted.trait.values) + vals <- utils::modifyList(vals, converted.trait.values) decompositon.xml <- PEcAn.settings::listToXml(vals, "decomposition") xml <- XML::append.xmlNode(xml, decompositon.xml) @@ -548,14 +548,14 @@ write.config.xml.ED2 <- function(settings, trait.values, defaults = settings$con converted.trait.values <- convert.samples.ED(trait.values[[i]]) ## Selectively replace defaults with trait values - vals <- modifyList(vals, converted.trait.values) + vals <- utils::modifyList(vals, converted.trait.values) ## Convert settings constants to ED units converted.defaults <- convert.samples.ED(defaults[[pft]]$constants) ## Selectively replace defaults and trait values with constants from settings if (!is.null(converted.defaults)){ - vals <- modifyList(vals, converted.defaults) + vals <- utils::modifyList(vals, converted.defaults) } ## Make sure that include_pft is set to 1 diff --git a/models/ed/R/write_ed_veg.R b/models/ed/R/write_ed_veg.R index d39a27304e3..07a6a6cac0a 100644 --- a/models/ed/R/write_ed_veg.R +++ b/models/ed/R/write_ed_veg.R @@ -39,7 +39,7 @@ write_ed_veg <- function(ed_veg, path_prefix) { #' @export write_css <- function(css, path_prefix, latitude = NULL, longitude = NULL) { css_fname <- prepare_ed_veg_filename(path_prefix, ".css", latitude, longitude) - write.table(css, css_fname, quote = FALSE, row.names = FALSE) + utils::write.table(css, css_fname, quote = FALSE, row.names = FALSE) invisible(css_fname) } @@ -47,7 +47,7 @@ write_css <- function(css, path_prefix, latitude = NULL, longitude = NULL) { #' @export write_pss <- function(pss, path_prefix, latitude = NULL, longitude = NULL) { pss_fname <- prepare_ed_veg_filename(path_prefix, ".pss", latitude, longitude) - write.table(pss, pss_fname, quote = FALSE, row.names = FALSE) + utils::write.table(pss, pss_fname, quote = FALSE, row.names = FALSE) invisible(pss_fname) } @@ -61,7 +61,7 @@ write_site <- function(site, path_prefix, latitude = NULL, longitude = NULL) { attr(site, "file_format") ) writeLines(first_line, site_fname) - write.table(site, site_fname, quote = FALSE, row.names = FALSE, append = TRUE) + utils::write.table(site, site_fname, quote = FALSE, row.names = FALSE, append = TRUE) invisible(site_fname) } diff --git a/models/ed/R/write_restart.ED2.R b/models/ed/R/write_restart.ED2.R index ea6e4012499..3a3611ad607 100644 --- a/models/ed/R/write_restart.ED2.R +++ b/models/ed/R/write_restart.ED2.R @@ -1,7 +1,18 @@ #' @title Write ED2 restart file from SDA results #' +#' @param outdir output directory +#' @param runid run id +#' @param start.time Time of current assimilation step +#' @param stop.time Time of next assimilation step +#' @param settings pecan settings list +#' @param new.state Analysis state matrix returned by `sda.enkf` +#' @param RENAME flag to either rename output file or not +#' @param new.params optional, additional params to pass `write.configs` that +#' are deterministically related to the parameters updated by the analysis +#' @param inputs new input paths updated by the SDA workflow, will be passed to +#' `write.configs` +#' #' @author Alexey Shiklomanov, Istem Fer -#' @inheritParams PEcAn.ModelName::write_restart.ModelName #' @return TRUE if successful #' @export write_restart.ED2 <- function(outdir, runid, start.time, stop.time, diff --git a/models/ed/man/ed.var.Rd b/models/ed/man/ed.var.Rd index fd79d0e2ba8..c5dc8c304f0 100644 --- a/models/ed/man/ed.var.Rd +++ b/models/ed/man/ed.var.Rd @@ -7,6 +7,9 @@ returns out list, readvar variables to read from file, expr if any derivation is \usage{ ed.var(varname) } +\arguments{ +\item{varname}{character; variable name to read from file} +} \description{ Lookup function for translating commonly used ED variables returns out list, readvar variables to read from file, expr if any derivation is needed diff --git a/models/ed/man/met2model.ED2.Rd b/models/ed/man/met2model.ED2.Rd index 3ec873ee373..277bf471db7 100644 --- a/models/ed/man/met2model.ED2.Rd +++ b/models/ed/man/met2model.ED2.Rd @@ -32,11 +32,17 @@ met2model.ED2( \item{lst}{timezone offset to GMT in hours} +\item{lat}{latitude; if not provide the function will attempt to discover it in input files} + +\item{lon}{longitude; if not provide the function will attempt to discover it in input files} + \item{overwrite}{should existing files be overwritten} \item{verbose}{should the function be very verbose} \item{leap_year}{Enforce Leap-years? If set to TRUE, will require leap years to have 366 days. If set to false, will require all years to have 365 days. Default = TRUE.} + +\item{...}{currently unused} } \description{ If files already exist in 'Outfolder', the default function is NOT to diff --git a/models/ed/man/run_ed_singularity.Rd b/models/ed/man/run_ed_singularity.Rd index 45392346391..8cdcc56d240 100644 --- a/models/ed/man/run_ed_singularity.Rd +++ b/models/ed/man/run_ed_singularity.Rd @@ -21,7 +21,7 @@ run_ed_singularity( \item{singularity_args}{Additional arguments to be passed to \verb{singularity run} (before)} -\item{Additional}{arguments to \link[base:system2]{base::system2}} +\item{...}{Additional arguments to \link[base:system2]{base::system2}} } \description{ Uses \link[base:system2]{base::system2} to run ED or EDR via a Singularity container. diff --git a/models/ed/man/translate_vars_ed.Rd b/models/ed/man/translate_vars_ed.Rd index c0a2c705888..56ba3237e96 100644 --- a/models/ed/man/translate_vars_ed.Rd +++ b/models/ed/man/translate_vars_ed.Rd @@ -2,12 +2,17 @@ % Please edit documentation in R/other.helpers.ED2.R \name{translate_vars_ed} \alias{translate_vars_ed} -\title{Function translating pecan vars to ED vars -var.names <- c("DBH", "AGB", "AbvGrndWood")} +\title{Function translating pecan vars to ED vars} \usage{ translate_vars_ed(varnames) } +\arguments{ +\item{varnames}{character; variable names to translate} +} \description{ Function translating pecan vars to ED vars +} +\examples{ var.names <- c("DBH", "AGB", "AbvGrndWood") +translate_vars_ed(var.names) } diff --git a/models/ed/man/write_restart.ED2.Rd b/models/ed/man/write_restart.ED2.Rd index 364ea0a85f0..840b4534ad6 100644 --- a/models/ed/man/write_restart.ED2.Rd +++ b/models/ed/man/write_restart.ED2.Rd @@ -17,7 +17,7 @@ write_restart.ED2( ) } \arguments{ -\item{outdir}{outout directory} +\item{outdir}{output directory} \item{runid}{run id} @@ -31,9 +31,11 @@ write_restart.ED2( \item{RENAME}{flag to either rename output file or not} -\item{new.params}{optional, additionals params to pass write.configs that are deterministically related to the parameters updated by the analysis} +\item{new.params}{optional, additional params to pass \code{write.configs} that +are deterministically related to the parameters updated by the analysis} -\item{inputs}{new input paths updated by the SDA workflow, will be passed to write.configs} +\item{inputs}{new input paths updated by the SDA workflow, will be passed to +\code{write.configs}} } \value{ TRUE if successful diff --git a/models/ed/tests/Rcheck_reference.log b/models/ed/tests/Rcheck_reference.log index 288070b0969..d478d30d2ae 100644 --- a/models/ed/tests/Rcheck_reference.log +++ b/models/ed/tests/Rcheck_reference.log @@ -1,81 +1,30 @@ -* using log directory ‘/home/tanishq010/pecan/models/PEcAn.ED2.Rcheck’ -* using R version 4.2.1 (2022-06-23) -* using platform: x86_64-pc-linux-gnu (64-bit) +* using log directory ‘/private/var/folders/wr/by_lst2d2fngf67mknmgf4340000gn/T/RtmplbRshU/file7b5043659c65/PEcAn.ED2.Rcheck’ +* using R version 4.2.2 (2022-10-31) +* using platform: x86_64-apple-darwin17.0 (64-bit) * using session charset: UTF-8 -* using options ‘--no-tests --no-manual --as-cran’ +* using options ‘--no-manual --as-cran’ * checking for file ‘PEcAn.ED2/DESCRIPTION’ ... OK * checking extension type ... Package -* this is package ‘PEcAn.ED2’ version ‘1.7.2’ +* this is package ‘PEcAn.ED2’ version ‘1.7.2.9000’ * package encoding: UTF-8 -* checking CRAN incoming feasibility ... WARNING -Maintainer: ‘Mike Dietze ’ - -New submission - -License components with restrictions and base license permitting such: - BSD_3_clause + file LICENSE -File 'LICENSE': - University of Illinois/NCSA Open Source License - - Copyright (c) 2012, University of Illinois, NCSA. All rights reserved. - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal with the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimers. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimers in the - documentation and/or other materials provided with the distribution. - - Neither the names of University of Illinois, NCSA, nor the names - of its contributors may be used to endorse or promote products - derived from this Software without specific prior written permission. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. - -Strong dependencies not in mainstream repositories: - PEcAn.data.atmosphere, PEcAn.data.land, PEcAn.logger, PEcAn.remote, - PEcAn.settings, PEcAn.utils - -The Date field is over a month old. * checking package namespace information ... OK -* checking package dependencies ... OK +* checking package dependencies ... NOTE +Imports includes 21 non-default packages. +Importing from so many packages makes the package vulnerable to any of +them becoming unavailable. Move as many as possible to Suggests and +use conditionally. * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for executable files ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK -* checking serialization versions ... OK -* checking whether package ‘PEcAn.ED2’ can be installed ... WARNING -Found the following significant warnings: - Note: next used in wrong context: no loop is visible -See ‘/home/tanishq010/pecan/models/PEcAn.ED2.Rcheck/00install.out’ for details. -Information on the location(s) of code generating the ‘Note’s can be -obtained by re-running with environment variable R_KEEP_PKG_SOURCE set -to ‘yes’. +* checking whether package ‘PEcAn.ED2’ can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking for future file timestamps ... OK -* checking DESCRIPTION meta-information ... NOTE -Author field differs from that derived from Authors@R - Author: ‘David LeBauer, Mike Dietze, Xiaohui Feng, Dan Wang, Carl Davidson, Rob Kooper, Shawn Serbin, Alexey Shiklomanov’ - Authors@R: ‘Mike Dietze [aut, cre], David LeBauer [aut], Xiaohui Feng [aut], Dan Wang [aut], Carl Davidson [aut], Rob Kooper [aut], Shawn Serbin [aut], Alexey Shiklomanov [aut], University of Illinois, NCSA [cph]’ - -* checking top-level files ... NOTE -Non-standard files/directories found at top level: - ‘Dockerfile’ ‘model_info.json’ ‘scripts’ +* checking DESCRIPTION meta-information ... OK +* checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK @@ -86,73 +35,14 @@ Non-standard files/directories found at top level: * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK -* checking loading without being on the library search path ... OK -* checking use of S3 registration ... OK -* checking dependencies in R code ... NOTE -Namespace in Imports field not imported from: ‘tibble’ - All declared Imports should be used. +* checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... NOTE -Warning: : ... may be used in an incorrect context: ‘check_pss(pss, ...)’ - -download_edi: no visible global function definition for ‘unzip’ -modify_df: no visible global function definition for ‘modifyList’ -modify_ed2in: no visible global function definition for ‘modifyList’ -put_E_values: no visible global function definition for ‘data’ -put_T_values: no visible global function definition for ‘head’ -read_E_files: no visible global function definition for ‘data’ -read_S_files: no visible global function definition for ‘data’ -read_css: no visible global function definition for ‘read.table’ -read_ed_metheader: no visible global function definition for - ‘read.table’ -read_pss: no visible global function definition for ‘read.table’ -read_pss: ... may be used in an incorrect context: ‘check_pss(pss, - ...)’ -read_site: no visible global function definition for ‘read.table’ -veg2model.ED2: no visible global function definition for ‘data’ -veg2model.ED2: no visible global function definition for ‘median’ -veg2model.ED2: no visible global function definition for ‘write.table’ -write.config.ED2: no visible global function definition for ‘saveXML’ -write.config.ED2: no visible global function definition for ‘db.query’ -write.config.ED2: no visible global function definition for - ‘modifyList’ -write.config.xml.ED2: no visible global function definition for ‘data’ -write.config.xml.ED2: no visible global function definition for - ‘modifyList’ -write_css: no visible global function definition for ‘write.table’ -write_pss: no visible global function definition for ‘write.table’ -write_site: no visible global function definition for ‘write.table’ -Undefined global functions or variables: - data db.query head median modifyList pftmapping read.table saveXML - soil unzip value_type write.table -Consider adding - importFrom("stats", "median") - importFrom("utils", "data", "head", "modifyList", "read.table", - "unzip", "write.table") -to your NAMESPACE file. - Found the following assignments to the global environment: File ‘PEcAn.ED2/R/model2netcdf.ED2.R’: assign(x, ed.dat[[x]], envir = .GlobalEnv) - -Found the following calls to data() loading into the global environment: -File ‘PEcAn.ED2/R/model2netcdf.ED2.R’: - data(pftmapping, package = "PEcAn.ED2") - data(pftmapping, package = "PEcAn.ED2") - data(pftmapping, package = "PEcAn.ED2") -File ‘PEcAn.ED2/R/veg2model.ED2.R’: - data(pftmapping, package = "PEcAn.ED2") -File ‘PEcAn.ED2/R/write.configs.ed.R’: - data(list = histfile, package = "PEcAn.ED2") - data(list = histfile, package = "PEcAn.ED2") - data(pftmapping, package = "PEcAn.ED2") - data(soil, package = "PEcAn.ED2") -See section ‘Good practice’ in ‘?data’. - -Warning: : ... may be used in an incorrect context: ‘check_pss(pss, ...)’ - * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd line widths ... OK @@ -161,41 +51,15 @@ Missing link or links in documentation object 'read_ed_metheader.Rd': ‘https://github.com/EDmodel/ED2/wiki/Drivers’ See section 'Cross-references' in the 'Writing R Extensions' manual. -* checking for missing documentation entries ... WARNING -Undocumented data sets: - ‘history’ ‘history.r46’ ‘history.r81’ ‘history.r82’ ‘history.r85’ - ‘history.rgit’ ‘pftmapping’ ‘soil’ -All user-level objects in a package should have documentation entries. -See chapter ‘Writing R documentation files’ in the ‘Writing R -Extensions’ manual. +* checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... WARNING -Undocumented arguments in documentation object 'ed.var' - ‘varname’ - -Undocumented arguments in documentation object 'met2model.ED2' - ‘lat’ ‘lon’ ‘...’ - Undocumented arguments in documentation object 'modify_ed2in' ‘ed2in’ -Undocumented arguments in documentation object 'put_T_values' - ‘yr’ ‘nc_var’ ‘out’ ‘lat’ ‘lon’ ‘begins’ ‘ends’ ‘...’ - Undocumented arguments in documentation object 'remove.config.ED2' ‘main.outdir’ ‘settings’ -Undocumented arguments in documentation object 'run_ed_singularity' - ‘...’ -Documented arguments not in \usage in documentation object 'run_ed_singularity': - ‘Additional’ - -Undocumented arguments in documentation object 'translate_vars_ed' - ‘varnames’ - -Undocumented arguments in documentation object 'write.config.ED2' - ‘...’ - Functions with \usage entries need to have the appropriate \alias entries, and all their arguments documented. The \usage entries must correspond to syntactically valid R code. @@ -205,17 +69,22 @@ Extensions’ manual. * checking for unstated dependencies in examples ... OK * checking contents of ‘data’ directory ... OK * checking data for non-ASCII characters ... OK +* checking LazyData ... OK * checking data for ASCII and uncompressed saves ... OK +* checking R/sysdata.rda ... OK * checking files in ‘vignettes’ ... WARNING Files in the 'vignettes' directory but no files in 'inst/doc': ‘running_ed_from_R.Rmd’ Package has no Sweave vignette sources and no VignetteBuilder field. * checking examples ... OK -* checking for unstated dependencies in ‘tests’ ... WARNING -'::' or ':::' import not declared from: ‘devtools’ -* checking tests ... SKIPPED +* checking for unstated dependencies in ‘tests’ ... OK +* checking tests ... + Running ‘test_ed_integration.R’ + Running ‘testthat.R’ OK * checking for non-standard things in the check directory ... OK * checking for detritus in the temp directory ... OK * DONE -Status: 7 WARNINGs, 4 NOTEs +Status: 3 WARNINGs, 2 NOTEs + +