Skip to content

Commit

Permalink
Merge branch 'develop' into delete-browndog
Browse files Browse the repository at this point in the history
  • Loading branch information
Sweetdevil144 authored Jul 31, 2024
2 parents e91ab05 + b4c3f92 commit 5dfb1dc
Show file tree
Hide file tree
Showing 114 changed files with 616 additions and 493 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci-weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
fail-fast: false
matrix:
R:
- "4.3"
- "devel"
uses: ./.github/workflows/test.yml
with:
Expand All @@ -24,6 +25,7 @@ jobs:
fail-fast: false
matrix:
R:
- "4.3"
- "devel"
uses: ./.github/workflows/check.yml
with:
Expand All @@ -36,6 +38,7 @@ jobs:
fail-fast: false
matrix:
R:
- "4.3"
- "devel"
uses: ./.github/workflows/sipnet.yml
with:
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/depends.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
- "4.1"
- "4.2"
- "4.3"
- "4.4"
- "devel"

steps:
Expand All @@ -49,11 +50,14 @@ jobs:

# calculate some variables that are used later
- name: github branch
# build Rdevel only on Mondays, others every day (but not twice on Mondays)
# build weekly-tested versions only on Mondays, others every day
# (but not twice on Mondays)
if: |
github.event_name == 'workflow_dispatch' ||
(matrix.R != 'devel' && github.event.schedule == '0 0 * * *') ||
(matrix.R == 'devel' && github.event.schedule == '30 1 * * 1')
(contains(fromJSON('["4.1", "4.2", "4.4"]'), matrix.R)
&& github.event.schedule == '0 0 * * *') ||
(contains(fromJSON('[4.3", "devel"]'), matrix.R)
&& github.event.schedule == '30 1 * * 1')
run: |
BRANCH=${GITHUB_REF##*/}
echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV
Expand Down
3 changes: 2 additions & 1 deletion base/db/tests/Rcheck_reference.log
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ The Date field is over a month old.
* checking package directory ... OK
* checking for future file timestamps ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking DESCRIPTION meta-information ... NOTE
License stub is invalid DCF.
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
Expand Down
1 change: 1 addition & 0 deletions base/qaqc/tests/Rcheck_reference.log
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Malformed Description field: should contain one or more complete sentences.
Authors@R field gives no person with name and roles.
Authors@R field gives no person with maintainer role, valid email
address and non-empty name.
License stub is invalid DCF.
* checking top-level files ... NOTE
Non-standard file/directory found at top level:
‘README.Rmd’
Expand Down
3 changes: 2 additions & 1 deletion base/remote/tests/Rcheck_reference.log
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
* checking whether package ‘PEcAn.remote’ can be installed ... OK
* checking installed package size ... OK
* checking package directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking DESCRIPTION meta-information ... NOTE
License stub is invalid DCF.
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
Expand Down
5 changes: 3 additions & 2 deletions base/settings/R/check.all.settings.R
Original file line number Diff line number Diff line change
Expand Up @@ -936,9 +936,10 @@ check.model.settings <- function(settings, dbcon = NULL) {
return(settings)
}

#' @title Check Workflow Settings
#' Check Workflow Settings
#' @param settings settings file
#' @export check.workflow.settings
#' @param dbcon database connection
#' @export
check.workflow.settings <- function(settings, dbcon = NULL) {
# check for workflow defaults
fixoutdir <- FALSE
Expand Down
2 changes: 2 additions & 0 deletions base/settings/man/check.workflow.settings.Rd

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

36 changes: 4 additions & 32 deletions base/settings/tests/Rcheck_reference.log
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ The Date field is over a month old.
* checking installed package size ... OK
* checking package directory ... OK
* checking for future file timestamps ... OK
* checking DESCRIPTION meta-information ... OK
* checking DESCRIPTION meta-information ... NOTE
License stub is invalid DCF.
* checking top-level files ... NOTE
Non-standard file/directory found at top level:
‘examples’
Expand Down Expand Up @@ -140,36 +141,7 @@ 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 code/documentation mismatches ... OK
* checking Rd \usage sections ... WARNING
Undocumented arguments in documentation object 'addSecrets'
‘force’

Undocumented arguments in documentation object 'check.model.settings'
‘dbcon’

Undocumented arguments in documentation object 'check.run.settings'
‘dbcon’

Undocumented arguments in documentation object 'check.settings'
‘force’

Undocumented arguments in documentation object 'check.workflow.settings'
‘dbcon’

Undocumented arguments in documentation object 'clean.settings'
‘write’

Undocumented arguments in documentation object 'fix.deprecated.settings'
‘force’

Undocumented arguments in documentation object 'update.settings'
‘force’

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.
See chapter ‘Writing R documentation files’ in the ‘Writing R
Extensions’ manual.
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking examples ... OK
Expand All @@ -179,4 +151,4 @@ Extensions’ manual.
* checking for detritus in the temp directory ... OK
* DONE

Status: 5 WARNINGs, 3 NOTEs
Status: 3 WARNINGs, 2 NOTEs
3 changes: 2 additions & 1 deletion base/utils/tests/Rcheck_reference.log
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ The Date field is over a month old.
* checking installed package size ... OK
* checking package directory ... OK
* checking for future file timestamps ... OK
* checking DESCRIPTION meta-information ... OK
* checking DESCRIPTION meta-information ... NOTE
License stub is invalid DCF.
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
Expand Down
3 changes: 3 additions & 0 deletions base/visualization/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ Imports:
stringr(>= 1.1.0)
Suggests:
grid,
knitr,
mockery,
png,
raster,
rmarkdown,
sp,
testthat (>= 1.0.2),
withr
Expand All @@ -49,5 +51,6 @@ Copyright: Authors
LazyLoad: yes
LazyData: FALSE
Encoding: UTF-8
VignetteBuilder: knitr
RoxygenNote: 7.3.2
Roxygen: list(markdown = TRUE)
2 changes: 1 addition & 1 deletion base/visualization/R/plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ plot_data <- function(trait.data, base.plot = NULL, ymax) {
##'
##' @return adds borders to ggplot as a side effect
##' @author Rudolf Cardinal
##' @author \url{ggplot2 google group}{https://groups.google.com/forum/?fromgroups#!topic/ggplot2/-ZjRE2OL8lE}
##' @author [ggplot2 google group](https://groups.google.com/forum/?fromgroups#!topic/ggplot2/-ZjRE2OL8lE)
##' @examples
##' \dontrun{
##' df = data.frame( x=c(1,2,3), y=c(4,5,6) )
Expand Down
2 changes: 1 addition & 1 deletion base/visualization/man/theme_border.Rd

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

3 changes: 2 additions & 1 deletion base/visualization/tests/Rcheck_reference.log
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ The Date field is over a month old.
* checking installed package size ... OK
* checking package directory ... OK
* checking for future file timestamps ... OK
* checking DESCRIPTION meta-information ... OK
* checking DESCRIPTION meta-information ... NOTE
License stub is invalid DCF.
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
Expand Down
20 changes: 16 additions & 4 deletions base/visualization/vignettes/usmap.Rmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
---
title: "Maps"
output: html_vignette
vignette: >
%\VignetteIndexEntry{Maps}
%\VignetteEngine{knitr::rmarkdown}
---



Map
========================================================

```{r}
(all code chunks are disabled because vignette build was throwing errors. TODO: debug and re-enable.)

```{r,eval=FALSE}
require(raster)
require(sp)
require(ggplot2)
Expand All @@ -20,7 +32,7 @@ spplot(spdf)

### Plot all maps for BETYdb

```{r}
```{r,eval=FALSE}
files <- dir("~/dev/bety/local/modelout", pattern="grid.csv", full.names=TRUE)
yieldfiles <- files[!grepl("evapotranspiration", files)]
etfiles <- files[grepl("evapotranspiration", files)]
Expand All @@ -42,7 +54,7 @@ for(file in etfiles){
```

### Misc additional code
```{r}
```{r,eval=FALSE}
# Make an evenly spaced raster, the same extent as original data
e <- extent( spdf )
Expand All @@ -63,7 +75,7 @@ ggplot( NULL ) + geom_raster( data = rdf , aes( x , y , fill = layer ) )
```

```{r}
```{r,eval=FALSE}
# from http://gis.stackexchange.com/a/20052/3218
require(rgdal)
proj4string(spdf) <- CRS("+init=epsg:4326")
Expand Down
2 changes: 1 addition & 1 deletion base/workflow/tests/Rcheck_reference.log
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Author field differs from that derived from Authors@R
Maintainer field differs from that derived from Authors@R
Maintainer: ‘David LeBauer <[email protected]>’
Authors@R: ‘David LeBauer <[email protected]>’

License stub is invalid DCF.
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
Expand Down
3 changes: 3 additions & 0 deletions docker/depends/pecan_package_dependencies.csv
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@
"jsonlite","*","models/stics","Imports",FALSE
"jsonlite","*","modules/data.atmosphere","Imports",FALSE
"jsonlite","*","modules/data.remote","Suggests",FALSE
"knitr","*","base/visualization","Suggests",FALSE
"knitr","*","modules/data.atmosphere","Suggests",FALSE
"knitr",">= 1.42","base/db","Suggests",FALSE
"knitr",">= 1.42","base/qaqc","Suggests",FALSE
"knitr",">= 1.42","modules/allometry","Suggests",FALSE
Expand Down Expand Up @@ -480,6 +482,7 @@
"rlang","*","modules/uncertainty","Imports",FALSE
"rlang",">= 0.2.0","modules/data.atmosphere","Imports",FALSE
"rlist","*","modules/assim.sequential","Suggests",FALSE
"rmarkdown","*","base/visualization","Suggests",FALSE
"rmarkdown",">= 2.19","base/db","Suggests",FALSE
"rmarkdown",">= 2.19","base/qaqc","Suggests",FALSE
"rmarkdown",">= 2.19","modules/allometry","Suggests",FALSE
Expand Down
29 changes: 16 additions & 13 deletions modules/allometry/R/AllomAve.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,27 @@
# http://opensource.ncsa.illinois.edu/license.html
#-------------------------------------------------------------------------------

#' @title AllomAve
#' @name AllomAve
#' @aliases AllomAve
#' AllomAve
#'
#' Allometry wrapper function that handles loading and subsetting the data,
#' fitting the Bayesian models, and generating diagnostic figures. Set up to loop over
#' multiple PFTs and components.
#' Writes raw MCMC and PDF of diagnositcs to file and returns table of summary stats.
#'
#' There are two usages of this function.
#' When running 'online' (connected to the PEcAn database), pass the database connection,
#' con, and the pfts subsection of the PEcAn settings.
#' When running 'stand alone' pass the pft list mapping species to species codes
#' and the file paths to the allometry table and field data (optional)
#'
#' @param pfts pft list from PEcAn settings (if con) OR list of pft spcd's
#' If the latter, the names within the list are used to identify PFTs
#' \itemize{
#' \describe{
#' \item{'acronym'}{ - USDA species acronyms (see plants.usda.gov), used with FIELD data (vector)}
#' \item{'spcd'}{ - USFS species codes, use with PARM data (vector)}
#' }
#' @param components IDs for allometry components from Jenkins et al 2004 Table 5. Default is stem biomass (6). See data(allom.components)
#' @param components IDs for allometry components from Jenkins et al 2004 Table 5.
#' Default is stem biomass (6). See data(allom.components)
#' @param outdir output directory files are written to. Default is getwd()
#' @param con database connection
#' @param field path(s) to raw data files
Expand All @@ -27,14 +38,6 @@
#' @param dmax maximum dbh of interest
#' @return nested list of parameter summary statistics
#' @export
#' @description allometery wrapper function that handles loading and subsetting the data,
#' fitting the Bayesian models, and generating diagnostic figures. Set up to loop over
#' multiple PFTs and components.
#' Writes raw MCMC and PDF of diagnositcs to file and returns table of summary stats.
#'
#' @details There are two usages of this function.
#' When running 'online' (connected to the PEcAn database), pass the database connection, con, and the pfts subsection of the PEcAn settings.
#' When running 'stand alone' pass the pft list mapping species to species codes and the file paths to the allometry table and field data (optional)
#'
#' @examples
#'
Expand Down
Loading

0 comments on commit 5dfb1dc

Please sign in to comment.