Skip to content

Commit

Permalink
conflict1 solved
Browse files Browse the repository at this point in the history
  • Loading branch information
Hhh-hyc committed Aug 19, 2024
2 parents e02b07c + bb2cda9 commit 0d37aef
Show file tree
Hide file tree
Showing 140 changed files with 1,985 additions and 645 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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ For more information about this file see also [Keep a Changelog](http://keepacha
- Added new feature of preparing initial conditions for MODIS LAI, AGB, ISCN SOC, and soil moisture across NA anchor sites.
- Added GEDI AGB preparation workflow.
- Added new feature of downloading datasets from the NASA DAAC ORNL database.
- Extended downscale function and created 'downscale_hrly' so that it handles more frequent data
- Added 'aggregate' as a new feature for downscaled data

### Fixed

Expand Down
45 changes: 45 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Contributor Covenant Code of Conduct

**Our Pledge**

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

**Our Standards**

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting



**Our Responsibilities**

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

**Scope**

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

**Enforcement**

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at pecanproj[at]gmail.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

**Attribution**

This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org/) version 1.4, available at [http://contributor-covenant.org/version/1/4](http://contributor-covenant.org/version/1/4/).
15 changes: 7 additions & 8 deletions DEV-INTRO.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ You can copy the [`docker/env.example`](docker/env.example) file as .env in your
cp docker/env.example .env
```


The variables we want to modify are:

- `COMPOSE_PROJECT_NAME`, the prefix for all containers. Set this to "pecan".
Expand Down Expand Up @@ -181,13 +180,13 @@ Next copy the R packages from a container to volume `pecan_lib`. This is not rea

You can copy all the data using the following command. This will copy all compiled packages to your local machine.

```
```bash
docker run -ti --rm -v pecan_R_library:/rlib pecan/base:develop cp -a /usr/local/lib/R/site-library/. /rlib/
```

If you have set a custom UID or GID in your `.env`, change ownership of these files as described above for the data volume. E.g. if you use the same UID in the containers as on your host machine, run:

```
```bash
docker run -ti --rm -v pecan_R_library:/rlib pecan/base:develop chown -R "$(id -u):$(id -g)" /rlib/
```

Expand All @@ -210,7 +209,7 @@ For Windows
copy docker\web\config.docker.php web\config.php
```

## PEcAn Development
## PEcAn Development Setup

To begin development we first have to bring up the full PEcAn stack. This assumes you have done once the steps above. You don\'t need to stop any running containers, you can use the following command to start all containers. At this point you have PEcAn running in docker.

Expand Down Expand Up @@ -239,13 +238,13 @@ R CMD ../web/workflow.R --settings docker.sipnet.xml

A better way of doing this is developed as part of GSOC, in which case you can leverage of the restful interface defined, or using the new R PEcAn API package.

# PEcAn URLs
## PEcAn URLs

You can check the RabbitMQ server used by pecan using <https://rabbitmq.pecan.localhost> on the same server that the docker stack is running on. You can use rstudio either with <http://server/rstudio> or at <http://rstudio.pecan.localhost>. To check the traefik dashboard you can use <http://traefik.pecan.localhost>.

If the stack is running on a remote machine, you can use ssh and port forwarding to connect to the server. For example `ssh -L 8000:localhost:80` will allow you to use <http://rabbitmq.pecan.localhost:8000/> in your browser to connect to the remote PEcAn server RabbitMQ.

# Directory Structure
## Directory Structure

Following are the main folders inside the pecan repository.

Expand Down Expand Up @@ -281,9 +280,9 @@ Some of the docker build files. The Dockerfiles for each model are placed in the

Small scripts that are used as part of the development and installation of PEcAn.

# Advanced Development Options
## Advanced Development Options

## Reset all containers/database
### Reset all containers/database

If you want to start from scratch and remove all old data, but keep your pecan checked out folder, you can remove the folders where you have written the data (see `folders` below). You will also need to remove any of the docker managed volumes. To see all volumes you can do `docker volume ls -q -f name=pecan`. If you are sure, you can either remove them one by one, or remove them all at once using the command below. **THIS DESTROYS ALL DATA IN DOCKER MANAGED VOLUMES.**.

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
2 changes: 1 addition & 1 deletion book_source/03_topical_pages/94_docker/04_models.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ It is important values for `type` and `version` are set correct. The PEcAn code

To build the docker image, we use a Dockerfile (see example below) and run the following command. This command will expect the Dockerfile to live in the model specific folder and the command is executed in the root pecan folder. It will copy the content of the pecan folder and make it available to the build process (in this example we do not need any additional files).

Since we can have multiple different versions of a model be available for PEcAn we ar using the following naming schema `pecan/model-<modeltype>-<version>:<pecan version`. For example the image below will be named pecan/model-ed2-git, since we do not specify the exact version it will be atomically be named `pecan/model-ed2-git:latest`.
Since we can have multiple different versions of a model be available for PEcAn we are using the following naming schema `pecan/model-<modeltype>-<version>:<pecan version`. For example the image below will be named pecan/model-ed2-git, since we do not specify the exact version it will be atomically be named `pecan/model-ed2-git:latest`.

````bash
docker build \
Expand Down
Loading

0 comments on commit 0d37aef

Please sign in to comment.