Skip to content

Commit

Permalink
Merge branch 'develop' into extend-workflows-api
Browse files Browse the repository at this point in the history
  • Loading branch information
mdietze authored Feb 1, 2024
2 parents 67f894e + dfd295e commit c834365
Show file tree
Hide file tree
Showing 286 changed files with 8,745 additions and 1,711 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,19 @@ jobs:
path: book_source/_book/
# download documentation repo
- name: Checkout documentation repo
if: github.event_name != 'pull_request'
if: github.event_name == 'push'
uses: actions/checkout@v3
with:
repository: ${{ github.repository_owner }}/pecan-documentation
path: pecan-documentation
token: ${{ secrets.GH_PAT }}
# upload new documentation
- name: publish to github
if: github.event_name != 'pull_request'
if: github.event_name == 'push'
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Documentation Robot"
export VERSION=${GITHUB_REF##*/}
export VERSION=$(echo $GITHUB_REF | sed 's,.*/,,' )
cd pecan-documentation
mkdir -p $VERSION
rsync -a --delete ../book_source/_book/ ${VERSION}/
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci-weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ jobs:
- name: check for out-of-date dependencies files
uses: infotroph/tree-is-clean@v1
- name: install newly-added dependencies
run: Rscript docker/depends/pecan.depends.R
working-directory: docker/depends
run: Rscript pecan.depends.R

# initialize database
- name: db setup
Expand Down Expand Up @@ -105,7 +106,7 @@ jobs:
- name: install utils
run: apt-get update && apt-get install -y postgresql-client qpdf
- name: install new dependencies
run: Rscript scripts/generate_dependencies.R && Rscript docker/depends/pecan.depends.R
run: Rscript scripts/generate_dependencies.R && cd docker/depends && Rscript pecan.depends.R

# run PEcAn checks
- name: check
Expand Down Expand Up @@ -152,7 +153,7 @@ jobs:
- name: install utils
run: apt-get update && apt-get install -y postgresql-client qpdf
- name: install new dependencies
run: Rscript scripts/generate_dependencies.R && Rscript docker/depends/pecan.depends.R
run: Rscript scripts/generate_dependencies.R && cd docker/depends && Rscript pecan.depends.R

# initialize database
- name: db setup
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
fail-fast: false
matrix:
R:
- "4.0"
- "4.2"
- "4.1"

services:
Expand All @@ -65,7 +65,8 @@ jobs:
- name: check for out-of-date dependencies files
uses: infotroph/tree-is-clean@v1
- name: install newly-added dependencies
run: Rscript docker/depends/pecan.depends.R
working-directory: docker/depends
run: Rscript pecan.depends.R

# initialize database
- name: db setup
Expand All @@ -89,8 +90,9 @@ jobs:
strategy:
fail-fast: false
matrix:
package: [check_base, check_modules, check_models]
R:
- "4.0"
- "4.2"
- "4.1"

env:
Expand Down Expand Up @@ -127,14 +129,16 @@ jobs:
- name: install utils
run: apt-get update && apt-get install -y postgresql-client qpdf
- name: install new dependencies
run: Rscript scripts/generate_dependencies.R && Rscript docker/depends/pecan.depends.R
run: Rscript scripts/generate_dependencies.R && cd docker/depends/ && Rscript pecan.depends.R

# run PEcAn checks
# The package names of base, modules, and models are passed as matrix variables to avoid repeatability of code
- name: check
run: make -j1 check
run: make -j1 ${{ matrix.package }}
env:
REBUILD_DOCS: "FALSE"
RUN_TESTS: "FALSE"

- name: check for out-of-date files
uses: infotroph/tree-is-clean@v1

Expand All @@ -152,7 +156,7 @@ jobs:
fail-fast: false
matrix:
R:
- "4.0"
- "4.2"
- "4.1"

services:
Expand All @@ -175,7 +179,7 @@ jobs:
- name: install utils
run: apt-get update && apt-get install -y postgresql-client qpdf
- name: install new dependencies
run: Rscript scripts/generate_dependencies.R && Rscript docker/depends/pecan.depends.R
run: Rscript scripts/generate_dependencies.R && cd docker/depends/ && Rscript pecan.depends.R

# initialize database
- name: db setup
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/depends.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
R:
- "4.0"
- "4.1"
- "4.2"
- "4.3"
- "devel"

steps:
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name : Integration Tests
on :
# allow manual triggering
workflow_dispatch:

schedule:
# run Thursday 4:30 AM UTC
- cron: '30 4 * * 4'
jobs:
test:
runs-on: ubuntu-20.04

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

container:
image: pecan/base:develop

steps:
- name: Checkout source code
uses: actions/checkout@v3

- name: Run tests
run: |
for FILE in modules/data.atmosphere/inst/integrationTests/*; do
if echo "$FILE" | grep -q "ERA5"; then
echo "Skipping file : $FILE"
else
Rscript "$FILE"
fi
done
5 changes: 3 additions & 2 deletions .github/workflows/styler-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ jobs:
- name: install any new dependencies
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
run: Rscript docker/depends/pecan.depends.R
working-directory: docker/depends
run: Rscript pecan.depends.R
- id: file_changes
uses: trilom/[email protected]
- name : make
Expand All @@ -82,7 +83,7 @@ jobs:
run: |
git config --global user.email "[email protected]"
git config --global user.name "PEcAn stylebot"
git add \*.Rd \*NAMESPACE Makefile.depends docker/depends/pecan.depends.R
git add \*.Rd \*NAMESPACE Makefile.depends docker/depends/pecan_package_dependencies.R docker/depends/pecan_deps_from_github.txt
if [ "$(git diff --name-only --cached)" != "" ]; then git commit -m 'automated documentation update' ; fi
- uses: r-lib/actions/pr-push@master
with:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ see if you need to change any of these:
- Added Observation preparation functions into the SDA workflow, which supports AGB, LAI, Soil Carbon, and Soil moisture.
- We are slowly change the license from NCSA opensource to BSD-3 to help with publishing PEcAn to CRAN.
- Added an optional `pfts` argument to `PEcAn.uncertainty::run.sensitivity.analysis()` so that sensitivity analysis and variance decomposition can be run on a subset of PFTs defined in `settings` if desired (#3155).
- Added new features of the SDA function including: 1) allow user-defined free-run mode;
2) allow user-defined parallel mode for the qsub submission; 3) allow user-defined email option to report the progress.
- The analysis function now supports the parallelization of multi-chain MCMC sampling with the fully randomized inits function.
- Added the new feature of the block-based SDA workflow, which supports the parallel computation.

### Fixed

Expand Down Expand Up @@ -80,6 +84,9 @@ convert data for a single PFT fixed (#1329, #2974, #2981)
- DDBH (change in DBH over time) is no longer extracted and summarized from monthly -E- files by `PEcAn.ED2::model2netcdf.ED2()`. We are not sure it makes sense to summarize this variable across cohorts of different sizes.
- The `yr` and `yfiles` arguments of `PEcAn.ED2::read_E_files()` are no longer used and the simulation date is extracted from the names of the .h5 files output by ED2.
- Update Dockerfile for sipnet/maespa/template to use pecan/models:tag to build.
- Fixed a bug in `PEcAn.utils::ud_convert()` where it failed with objects of class "difftime" introduced by refactoring to use the `units` package instead of `udunits` (#3012)
- The propagation of aqq and bqq for the SINGLE Q type has been corrected.
- The issue where the indirect constraints will be increase with the increase of the covariance sizes.

### Changed

Expand All @@ -101,6 +108,7 @@ convert data for a single PFT fixed (#1329, #2974, #2981)
- Internal changes to keep up to date with tidyselect v1.2.0
- The `PEcAn.utils::download.file()` function has now been renamed to `PEcAn.utils::download_file()`
- The `regrid()` and `grid2netcdf()` function from `PEcAn.utils` have been moved to `PEcAn.data.remote` package.
- Web is now build using PHP 8 since PHP 7 is EOL.

### Removed

Expand Down
27 changes: 15 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# How to contribute

Third-party contributions are highly encouraged for PEcAn and will grow the code as well as the understanding of PEcAn and its applications. The core development team can not add all models that exist to PEcAn or all possible scenarios and analysis that people want to conduct. Our goal is to keep it as easy as possible for you contribute changes that get things working in your environment.
Third-party contributions are highly encouraged for PEcAn and will grow the code as well as the understanding of PEcAn and its applications. The core development team can not add all models that exist to PEcAn or all possible scenarios and analysis that people want to conduct. Our goal is to keep it as easy as possible for you contribute changes that get things working in your environment.
There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.

## PEcAn CORE vs Models vs Modules

New functionality is typically directed toward modules to provide a slimmer PEcAn Core, reducing the requirements to get PEcAn running on different platforms, especially HPC machines, and to allow greater freedom for modules and models.

Generally, new model should be added to the models folder and new modules should be added to the modules folder.
Generally, new model should be added to the models folder and new modules should be added to the modules folder.
Exceptions include code that is reused in many models or modules and wrapper functions that call specific implementations in models; these can be placed in the core packages.

If you are unsure of whether your contribution should be implemented as a model, module or part of PEcAn Core, you may visit [Chat Room](https://join.slack.com/t/pecanproject/shared_invite/enQtMzkyODUyMjQyNTgzLWEzOTM1ZjhmYWUxNzYwYzkxMWVlODAyZWQwYjliYzA0MDA0MjE4YmMyOTFhMjYyMjYzN2FjODE4N2Y4YWFhZmQ) or ask on the pecan-develop mailing list for advice.
Expand All @@ -16,9 +16,9 @@ If you are unsure of whether your contribution should be implemented as a model,

- Make sure you have a GitHub account.
- Search GitHub and Google to see if your issue has already been reported
- Create an issue in GitHub, assuming one does not already exist.
- Clearly describe the issue including steps to reproduce when it is a bug.
- Make sure you fill in the earliest version that you know has the issue.
- Create an issue in GitHub, assuming one does not already exist.
- Clearly describe the issue including steps to reproduce when it is a bug.
- Make sure you fill in the earliest version that you know has the issue.
- Ask @dlebauer, @mdietze or @robkooper to add you to the PEcAn project if you plan on fixing the issue.

## Getting Started
Expand All @@ -33,17 +33,20 @@ At this point you will have a copy of PEcAn and you are almost ready to work on
At this point you will have a copy of the pecan repo in your personal space. Next steps are to setup your local copy to work with the forked version.

Introduce your self to GIT (if you have not done this yet), make sure you use an email associated with your GitHub account.

```bash
git config --global user.name "John Doe"
git config --global user.email [email protected]
```

Switch pecan to your fork

```bash
git remote set-url origin https://github.com/<your username>/pecan.git
```

Setup pecan to be able to fetch from the master/develop

```bash
git remote add upstream https://github.com/PecanProject/pecan.git
```
Expand All @@ -66,30 +69,30 @@ Here is a simplified workflow on how add a new feature:

Update your develop (both locally and on GitHub)

```
```bash
git fetch upstream
git checkout develop
git merge upstream/develop
git push
```

### Create a branch to do your work.
### Create a branch to do your work

A good practice is to call the branch in the form of GH-<issue-number> followed by the title of the issue. This makes it easier to find out the issue you are trying to solve and helps us to understand what is done in the branch. Calling a branch my-work is confusing. Names of branch can not have a space, and should be replaced with a hyphen.
A good practice is to call the branch in the form of `GH-<issue-number>` followed by the title of the issue. This makes it easier to find out the issue you are trying to solve and helps us to understand what is done in the branch. Calling a branch my-work is confusing. Names of branch can not have a space, and should be replaced with a hyphen.

```
```bash
git checkout -b GH-issuenumber-title-of-issue
```

### Work and commit

Do you work, and commit as you see fit.Make your commit messages helpful.
Do you work, and commit as you see fit.Make your commit messages helpful.

### Push your changes up to GitHub.
### Push your changes up to GitHub

If this is the first time pushing to GitHub you will need to extended command, other wise you can simply do a `git push`.

```
```bash
git push -u origin GH-issuenumber-title-of-issue
```

Expand Down
2 changes: 2 additions & 0 deletions DEBUGING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# DEBUGGING.MD

Adding the following to the workflow.R or to your .Rprofile will enable
printing of a stacktrace in case something goes wrong. This will help
with the development of PEcAn.
Expand Down
Loading

0 comments on commit c834365

Please sign in to comment.