Skip to content

Commit

Permalink
Merge branch 'PecanProject:develop' into fix_warnings_uncertainty
Browse files Browse the repository at this point in the history
  • Loading branch information
moki1202 authored Jan 3, 2024
2 parents 577b0a2 + 03cbff8 commit 470fe83
Show file tree
Hide file tree
Showing 41 changed files with 1,579 additions and 485 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
125 changes: 7 additions & 118 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 Down Expand Up @@ -82,15 +82,16 @@ jobs:
# ----------------------------------------------------------------------
# R CHECK
# ----------------------------------------------------------------------
check_base:
check:
if: github.event_name != 'issue_comment' || startsWith(github.event.comment.body, '/build')
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
package: [check_base, check_modules, check_models]
R:
- "4.0"
- "4.2"
- "4.1"

env:
Expand Down Expand Up @@ -130,127 +131,15 @@ jobs:
run: Rscript scripts/generate_dependencies.R && Rscript docker/depends/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_base
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

check_modules:
if: github.event_name != 'issue_comment' || startsWith(github.event.comment.body, '/build')
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
R:
- "4.0"
- "4.1"

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
_R_CHECK_LENGTH_1_CONDITION_: true
_R_CHECK_LENGTH_1_LOGIC2_: true
# Avoid compilation check warnings that come from the system Makevars
# See https://stat.ethz.ch/pipermail/r-package-devel/2019q2/003898.html
_R_CHECK_COMPILATION_FLAGS_KNOWN_: -Wformat -Werror=format-security -Wdate-time
# Keep R checks from trying to consult the very flaky worldclockapi.com
_R_CHECK_SYSTEM_CLOCK_: 0

container:
image: pecan/depends:R${{ matrix.R }}

steps:
# checkout source code
- name: work around https://github.com/actions/checkout/issues/766
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- uses: actions/checkout@v3
with:
set-safe-directory: false

# Forbid spaces in names. Yes, *we* know it's not 1980 anymore, but Make doesn't.
- name: check for filenames that would confuse Make
run: |
SPACENAMES=`find . -name '* *'`
if [ -n "$SPACENAMES" ]; then
echo "::error file=${SPACENAMES}::Spaces in filename(s): ${SPACENAMES}. Please rename these files by converting spaces to underscores."
exit 1
fi
# install additional tools needed
- 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 PEcAn checks
- name: check
run: make -j1 check_modules
env:
REBUILD_DOCS: "FALSE"
RUN_TESTS: "FALSE"

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

check_models:
if: github.event_name != 'issue_comment' || startsWith(github.event.comment.body, '/build')
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
R:
- "4.0"
- "4.1"

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
_R_CHECK_LENGTH_1_CONDITION_: true
_R_CHECK_LENGTH_1_LOGIC2_: true
# Avoid compilation check warnings that come from the system Makevars
# See https://stat.ethz.ch/pipermail/r-package-devel/2019q2/003898.html
_R_CHECK_COMPILATION_FLAGS_KNOWN_: -Wformat -Werror=format-security -Wdate-time
# Keep R checks from trying to consult the very flaky worldclockapi.com
_R_CHECK_SYSTEM_CLOCK_: 0

container:
image: pecan/depends:R${{ matrix.R }}

steps:
# checkout source code
- name: work around https://github.com/actions/checkout/issues/766
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- uses: actions/checkout@v3
with:
set-safe-directory: false

# Forbid spaces in names. Yes, *we* know it's not 1980 anymore, but Make doesn't.
- name: check for filenames that would confuse Make
run: |
SPACENAMES=`find . -name '* *'`
if [ -n "$SPACENAMES" ]; then
echo "::error file=${SPACENAMES}::Spaces in filename(s): ${SPACENAMES}. Please rename these files by converting spaces to underscores."
exit 1
fi
# install additional tools needed
- 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 PEcAn checks
- name: check
run: make -j1 check_models
env:
REBUILD_DOCS: "FALSE"
RUN_TESTS: "FALSE"
- name: check for out-of-date files
uses: infotroph/tree-is-clean@v1


# ----------------------------------------------------------------------
Expand All @@ -266,7 +155,7 @@ jobs:
fail-fast: false
matrix:
R:
- "4.0"
- "4.2"
- "4.1"

services:
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ see if you need to change any of these:
- 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
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 470fe83

Please sign in to comment.