diff --git a/.github/workflows/book.yml b/.github/workflows/book.yml index a7551fdf2f2..240ebd88774 100644 --- a/.github/workflows/book.yml +++ b/.github/workflows/book.yml @@ -3,7 +3,7 @@ name: renderbook on: push: branches: - - master + - main - develop tags: - '*' @@ -65,9 +65,12 @@ jobs: git config --global user.email "pecanproj@gmail.com" git config --global user.name "GitHub Documentation Robot" export VERSION=$(echo $GITHUB_REF | sed 's,.*/,,' ) + if [ "$VERSION" == "main" ]; then + export VERSION=latest + fi cd pecan-documentation mkdir -p $VERSION rsync -a --delete ../book_source/_book/ ${VERSION}/ git add --all * git commit -m "Build book from pecan revision ${GITHUB_SHA}" || true - git push -q origin master + git push -q origin main diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3bc37aa5a17..24ef77419b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,11 +3,10 @@ name: CI on: push: branches: - - master + - main - develop - tags: - - '*' + - "v*.*.*" pull_request: merge_group: issue_comment: diff --git a/.github/workflows/depends.yml b/.github/workflows/depends.yml deleted file mode 100644 index 7416d7486de..00000000000 --- a/.github/workflows/depends.yml +++ /dev/null @@ -1,102 +0,0 @@ -name: Docker Depends Image - -on: - push: - branches: - - develop - - master - workflow_dispatch: - - # this runs on the develop branch - schedule: - - cron: '0 0 * * *' # midnight daily - - cron: '30 1 * * 1' # 1:30 AM every Monday (devel only) - -env: - # official supported version of R - SUPPORTED: 4.1 - DOCKERHUB_ORG: pecan - -jobs: - depends: - if: github.repository == 'PecanProject/pecan' - runs-on: ubuntu-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - - strategy: - fail-fast: false - matrix: - R: - - "4.1" - - "4.2" - - "4.3" - - "4.4" - - "devel" - - steps: - - name: Work around https://github.com/actions/checkout/issues/766 - run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - - uses: actions/checkout@v4 - with: - set-safe-directory: false - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - driver: docker - buildkitd-flags: --debug - install: true - - # calculate some variables that are used later - - name: github branch - # build weekly-tested versions only on Mondays, others every day - # (but not twice on Mondays) - if: | - github.event_name == 'workflow_dispatch' || - (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 - - tags="R${{ matrix.R }}" - if [ "${{ matrix.R }}" == "${{ env.SUPPORTED }}" ]; then - if [ "$BRANCH" == "master" ]; then - tags="${tags},latest" - elif [ "$BRANCH" == "develop" ]; then - tags="${tags},develop" - fi - fi - echo "TAG=${tags}" >> $GITHUB_ENV - - # this will publish to the actor (person) github packages - - name: Publish to GitHub - if: env.TAG != '' - uses: elgohr/Publish-Docker-Github-Action@v5 - env: - R_VERSION: ${{ matrix.R }} - with: - name: ${{ github.repository_owner }}/pecan/depends - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - context: docker/depends - tags: "${{ env.TAG }}" - registry: docker.pkg.github.com - buildargs: R_VERSION - - # this will publish to the clowder dockerhub repo - - name: Publish to Docker Hub - if: env.TAG != '' - uses: elgohr/Publish-Docker-Github-Action@v5 - env: - R_VERSION: ${{ matrix.R }} - with: - name: ${{ env.DOCKERHUB_ORG }}/depends - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - context: docker/depends - tags: "${{ env.TAG }}" - buildargs: R_VERSION diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index fded4f7376c..807e621f5d8 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,136 +1,615 @@ -name: Docker - -# initially we would us on: [release] as well, the problem is that -# the code in clowder would not know what branch the code is in, -# and would not set the right version flags. - -# This will run when: -# - when new code is pushed to master/develop to push the tags -# latest and develop -# - when a pull request is created and updated to make sure the -# Dockerfile is still valid. -# To be able to push to dockerhub, this expects the following -# secrets to be set in the project: -# - DOCKERHUB_USERNAME : username that can push to the org -# - DOCKERHUB_PASSWORD : password asscoaited with the username +name: Docker GHA + on: push: branches: - - master + - main - develop + tags: + - "v*.*.*" pull_request: merge_group: - issue_comment: - types: - - created workflow_dispatch: + inputs: + r_version: + description: 'R version to use' + required: true + type: choice + default: "4.1" + options: + - 4.1 + - 4.2 + - 4.3 + - 4.4 + - devel -# Certain actions will only run when this is the master repo. +# set up the environment, either input or default env: - MASTER_REPO: PecanProject/pecan - DOCKERHUB_ORG: pecan - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_VERSION: ${{ github.event.inputs.r_version || '4.1' }} +# there are 3 jobs to build different images jobs: - docker: - if: github.event_name != 'issue_comment' || startsWith(github.event.comment.body, '/build') + # ---------------------------------------------------------------------- + # depends image has all the dependencies installed + # ---------------------------------------------------------------------- + depends: runs-on: ubuntu-latest + permissions: + packages: write steps: - - name: Work around https://github.com/actions/checkout/issues/766 - run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - uses: actions/checkout@v4 + + # create metadata for image + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 with: - set-safe-directory: false + # list of Docker images to use as base name for tags + images: | + pecan/depends + ghcr.io/${{ github.repository_owner }}/${{ github.repository }}/depends + # generate Docker tags based on the following events/attributes + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + + # setup docker build + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + id: buildx uses: docker/setup-buildx-action@v3 + + - name: Inspect Builder + run: | + echo "Name: ${{ steps.buildx.outputs.name }}" + echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}" + echo "Status: ${{ steps.buildx.outputs.status }}" + echo "Flags: ${{ steps.buildx.outputs.flags }}" + echo "Platforms: ${{ steps.buildx.outputs.platforms }}" + + # login to registries + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # build the docker images + - name: Build and push depends + uses: docker/build-push-action@v6 + with: + context: docker/depends + file: docker/depends/Dockerfile + push: true + platforms: "linux/amd64" + cache-from: type=registry,ref=pecan/depends:buildcache + cache-to: type=registry,ref=pecan/depends:buildcache,mode=max + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + VERSION=${{ steps.meta.outputs.version }} + R_VERSION=${{ env.R_VERSION }} + GITHUB_PAT=${{ secrets.GITHUB_TOKEN }} + + # ---------------------------------------------------------------------- + # base image has PEcAn compiled and installed, and depends on depends + # ---------------------------------------------------------------------- + base: + runs-on: ubuntu-latest + needs: depends + permissions: + packages: write + + steps: + - uses: actions/checkout@v4 + + # create metadata for image + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 with: - driver: docker - buildkitd-flags: --debug - install: true + # list of Docker images to use as base name for tags + images: | + pecan/base + ghcr.io/${{ github.repository_owner }}/${{ github.repository }}/base + # generate Docker tags based on the following events/attributes + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + + # setup docker build + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 - # calculate some variables that are used later - - name: get version tag + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Inspect Builder run: | - BRANCH=${GITHUB_REF##*/} - echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV - if [ "$BRANCH" == "master" ]; then - version="$(awk '/Version:/ { print $2 }' base/all/DESCRIPTION)" - tags="latest" - oldversion="" - while [ "${oldversion}" != "${version}" ]; do - oldversion="${version}" - tags="${tags},${version}" - version=${version%.*} - done - echo "PECAN_VERSION=$(awk '/Version:/ { print $2 }' base/all/DESCRIPTION)" >> $GITHUB_ENV - echo "PECAN_TAGS=${tags}" >> $GITHUB_ENV - elif [ "$BRANCH" == "develop" ]; then - echo "PECAN_VERSION=develop" >> $GITHUB_ENV - echo "PECAN_TAGS=develop" >> $GITHUB_ENV - else - echo "PECAN_VERSION=develop" >> $GITHUB_ENV - echo "PECAN_TAGS=develop" >> $GITHUB_ENV - fi - # If any dependencies changed in this PR, try to update depends image - - name: check for changed dependencies - uses: dorny/paths-filter@v3 - id: findchanges - with: - filters: | - deps: - - docker/depends/** - - if: steps.findchanges.outputs.deps == 'true' - # NB: GITHUB_BASE_REF is only set on pull requests, - # so non-PR builds will find no existing tag and build fresh + echo "Name: ${{ steps.buildx.outputs.name }}" + echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}" + echo "Status: ${{ steps.buildx.outputs.status }}" + echo "Flags: ${{ steps.buildx.outputs.flags }}" + echo "Platforms: ${{ steps.buildx.outputs.platforms }}" + + # login to registries + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # build the docker images + - name: Build and push base + uses: docker/build-push-action@v6 + with: + context: . + file: docker/base/Dockerfile + push: true + platforms: "linux/amd64" + cache-from: type=registry,ref=pecan/base:buildcache + cache-to: type=registry,ref=pecan/base:buildcache,mode=max + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + VERSION=${{ steps.meta.outputs.version }} + R_VERSION=${{ env.R_VERSION }} + FROM_IMAGE=depends + IMAGE_VERSION=${{ steps.meta.outputs.version }} + GITHUB_PAT=${{ secrets.GITHUB_TOKEN }} + PECAN_VERSION=${{ steps.meta.outputs.version }} + PECAN_GIT_BRANCH= ${{ github.head_ref || github.ref_name }} + PECAN_GIT_CHECKSUM=${{ github.sha }} + PECAN_GIT_DATE=${{ github.event.repository.updated_at }} + +# ---------------------------------------------------------------------- +# models image has some python installed to run models, depends on base +# ---------------------------------------------------------------------- + models: + runs-on: ubuntu-latest + needs: base + permissions: + packages: write + + steps: + - uses: actions/checkout@v4 + + # create metadata for image + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + # list of Docker images to use as models name for tags + images: | + pecan/models + ghcr.io/${{ github.repository_owner }}/${{ github.repository }}/models + # generate Docker tags based on the following events/attributes + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + + # setup docker build + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Inspect Builder run: | - if $(docker manifest inspect pecan/depends:${GITHUB_BASE_REF##*/} > /dev/null 2>&1); then - echo "UPDATE_DEPENDS_FROM_TAG=${GITHUB_BASE_REF##*/}" >> $GITHUB_ENV - else - echo "BUILD_DEPENDS_FRESH=true" >> GITHUB_ENV - fi - env: - GITHUB_BASE_REF: ${{ github.base_ref }} - # use shell script to build, there is some complexity in this - - name: create images - run: ./docker.sh -i github - env: - PECAN_GIT_CHECKSUM: ${{ github.sha }} - PECAN_GIT_BRANCH: ${GITHUB_BRANCH} - VERSION: ${{ env.PECAN_VERSION }} - UPDATE_DEPENDS_FROM_TAG: ${{ env.UPDATE_DEPENDS_FROM_TAG }} - BUILD: ${{ env.BUILD_DEPENDS_FRESH }} - - # push all images to github - - name: Publish to GitHub - if: github.event_name == 'push' && github.repository == env.MASTER_REPO + echo "Name: ${{ steps.buildx.outputs.name }}" + echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}" + echo "Status: ${{ steps.buildx.outputs.status }}" + echo "Flags: ${{ steps.buildx.outputs.flags }}" + echo "Platforms: ${{ steps.buildx.outputs.platforms }}" + + # login to registries + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # build the docker images + - name: Build and push models + uses: docker/build-push-action@v6 + with: + context: docker/models + file: docker/models/Dockerfile + push: true + platforms: "linux/amd64" + cache-from: type=registry,ref=pecan/models:buildcache + cache-to: type=registry,ref=pecan/models:buildcache,mode=max + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + VERSION=${{ steps.meta.outputs.version }} + R_VERSION=${{ env.R_VERSION }} + FROM_IMAGE=depends + IMAGE_VERSION=${{ steps.meta.outputs.version }} + GITHUB_PAT=${{ secrets.GITHUB_TOKEN }} + PECAN_VERSION=${{ steps.meta.outputs.version }} + PECAN_GIT_BRANCH= ${{ github.head_ref || github.ref_name }} + PECAN_GIT_CHECKSUM=${{ github.sha }} + PECAN_GIT_DATE=${{ github.event.repository.updated_at }} + +# ---------------------------------------------------------------------- +# Next are images that have models installed +# ---------------------------------------------------------------------- + modelsbinary: + runs-on: ubuntu-latest + needs: models + permissions: + packages: write + strategy: + fail-fast: false + matrix: + name: + - basgra + - biocro + # - ed2_2.2.0 + - ed2_git + - maespa + - sipnet + include: + - name: basgra + CONTEXT: models/basgra + DOCKERFILE: models/basgra/Dockerfile + PLATFORM: "linux/amd64" + MODEL: basgra + VERSION: BASGRA_N_v1 + - name: biocro + CONTEXT: models/biocro + DOCKERFILE: models/biocro/Dockerfile + PLATFORM: "linux/amd64" + MODEL: biocro + VERSION: "0.95" + # - name: ed2_2.2.0 + # CONTEXT: models/ed + # DOCKERFILE: models/ed/Dockerfile + # PLATFORM: "linux/amd64" + # MODEL: ed2 + # VERSION: "2.2.0" + - name: ed2_git + CONTEXT: models/ed + DOCKERFILE: models/ed/Dockerfile + PLATFORM: "linux/amd64" + MODEL: ed2 + VERSION: "git" + - name: maespa + CONTEXT: models/maespa + DOCKERFILE: models/maespa/Dockerfile + PLATFORM: "linux/amd64" + MODEL: maespa + VERSION: "git" + - name: sipnet + CONTEXT: models/sipnet + DOCKERFILE: models/sipnet/Dockerfile + PLATFORM: "linux/amd64" + MODEL: sipnet + VERSION: "git" + + steps: + - uses: actions/checkout@v4 + + # lower case name for docker + - name: docker image name + id: lower + run: echo "image_name=$(echo model-${{ matrix.MODEL }}-${{ matrix.VERSION }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT + + # create metadata for image + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + # list of Docker images to use as base name for tags + images: | + pecan/${{ steps.lower.outputs.image_name }} + ghcr.io/${{ github.repository_owner }}/${{ github.repository }}/${{ steps.lower.outputs.image_name }} + # generate Docker tags based on the following events/attributes + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + + # setup docker build + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Inspect Builder run: | - echo "${INPUT_PASSWORD}" | docker login -u ${INPUT_USERNAME} --password-stdin ${INPUT_REGISTRY} - repo=$(echo ${{ github.repository_owner }} | tr 'A-Z' 'a-z') - for image in $(docker image ls pecan/*:github --format "{{ .Repository }}"); do - for v in ${PECAN_TAGS}; do - docker tag ${image}:github ${INPUT_REGISTRY}/${repo}/${image#pecan/}:${v} - docker push ${INPUT_REGISTRY}/${repo}/${image#pecan/}:${v} - done - done - docker logout - env: - INPUT_REGISTRY: ghcr.io - INPUT_USERNAME: ${{ secrets.GHCR_USERNAME }} - INPUT_PASSWORD: ${{ secrets.GHCR_PASSWORD }} - - # push all images to dockerhub - - name: Publish to DockerHub - if: github.event_name == 'push' && github.repository == env.MASTER_REPO + echo "Name: ${{ steps.buildx.outputs.name }}" + echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}" + echo "Status: ${{ steps.buildx.outputs.status }}" + echo "Flags: ${{ steps.buildx.outputs.flags }}" + echo "Platforms: ${{ steps.buildx.outputs.platforms }}" + + # login to registries + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: docker image ls + run: docker image ls + + # build the docker images + - name: Build and push ${{ matrix.MODEL }} ${{ matrix.VERSION }} + uses: docker/build-push-action@v6 + with: + context: ${{ matrix.CONTEXT }} + file: ${{ matrix.DOCKERFILE }} + push: true + platforms: ${{ matrix.PLATFORM }} + cache-from: type=registry,ref=pecan/${{ steps.lower.outputs.image_name }}:buildcache + cache-to: type=registry,ref=pecan/${{ steps.lower.outputs.image_name }}:buildcache,mode=max + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + VERSION=${{ steps.meta.outputs.version }} + R_VERSION=${{ env.R_VERSION }} + MODEL_VERSION=${{ matrix.VERSION }} + IMAGE_VERSION=${{ steps.meta.outputs.version }} + + # ---------------------------------------------------------------------- + # Next are images that depend on base image + # ---------------------------------------------------------------------- + baseplus: + runs-on: ubuntu-latest + needs: base + permissions: + packages: write + strategy: + fail-fast: false + matrix: + name: + - docs + - executor + - api + include: + - name: docs + CONTEXT: . + DOCKERFILE: docker/docs/Dockerfile + PLATFORM: "linux/amd64" + IMAGE: docs + - name: executor + CONTEXT: docker/executor + DOCKERFILE: docker/executor/Dockerfile + PLATFORM: "linux/amd64" + IMAGE: executor + - name: api + CONTEXT: apps/api + DOCKERFILE: apps/api/Dockerfile + PLATFORM: "linux/amd64" + IMAGE: api + + steps: + - uses: actions/checkout@v4 + + # create metadata for image + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + # list of Docker images to use as base name for tags + images: | + pecan/${{ matrix.IMAGE }} + ghcr.io/${{ github.repository_owner }}/${{ github.repository }}/${{ matrix.IMAGE }} + # generate Docker tags based on the following events/attributes + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + + # setup docker build + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Inspect Builder run: | - echo "${INPUT_PASSWORD}" | docker login -u ${INPUT_USERNAME} --password-stdin - for image in $(docker image ls pecan/*:github --format "{{ .Repository }}"); do - for v in ${PECAN_TAGS}; do - docker tag ${image}:github ${{ env.DOCKERHUB_ORG }}/${image#pecan/}:${v} - docker push ${{ env.DOCKERHUB_ORG }}/${image#pecan/}:${v} - done - done - docker logout - env: - INPUT_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - INPUT_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} + echo "Name: ${{ steps.buildx.outputs.name }}" + echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}" + echo "Status: ${{ steps.buildx.outputs.status }}" + echo "Flags: ${{ steps.buildx.outputs.flags }}" + echo "Platforms: ${{ steps.buildx.outputs.platforms }}" + + # login to registries + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # build the docker images + - name: Build and push ${{ matrix.name }} + uses: docker/build-push-action@v6 + with: + context: ${{ matrix.CONTEXT }} + file: ${{ matrix.DOCKERFILE }} + push: true + platforms: ${{ matrix.PLATFORM }} + cache-from: type=registry,ref=pecan/${{ matrix.IMAGE }}:buildcache + cache-to: type=registry,ref=pecan/${{ matrix.IMAGE }}:buildcache,mode=max + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + VERSION=${{ steps.meta.outputs.version }} + R_VERSION=${{ env.R_VERSION }} + IMAGE_VERSION=${{ steps.meta.outputs.version }} + + # ---------------------------------------------------------------------- + # Next are images that do not depend on either depends or base image + # ---------------------------------------------------------------------- + extras: + runs-on: ubuntu-latest + permissions: + packages: write + strategy: + fail-fast: false + matrix: + name: + - web + - dbsync + - data + - monitor + - rstudio-nginx + include: + - name: web + CONTEXT: . + DOCKERFILE: docker/web/Dockerfile + PLATFORM: "linux/amd64,linux/arm64" + IMAGE: web + - name: dbsync + CONTEXT: . + DOCKERFILE: shiny/dbsync/Dockerfile + PLATFORM: "linux/amd64" + IMAGE: shiny-dbsync + - name: data + CONTEXT: docker/data + DOCKERFILE: docker/data/Dockerfile + PLATFORM: "linux/amd64,linux/arm64" + IMAGE: data + - name: monitor + CONTEXT: docker/monitor + DOCKERFILE: docker/monitor/Dockerfile + PLATFORM: "linux/amd64,linux/arm64" + IMAGE: monitor + - name: rstudio-nginx + CONTEXT: docker/rstudio-nginx + DOCKERFILE: docker/rstudio-nginx/Dockerfile + PLATFORM: "linux/amd64,linux/arm64" + IMAGE: rstudio-nginx + + steps: + - uses: actions/checkout@v4 + + # create metadata for image + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + # list of Docker images to use as base name for tags + images: | + pecan/${{ matrix.IMAGE }} + ghcr.io/${{ github.repository_owner }}/${{ github.repository }}/${{ matrix.IMAGE }} + # generate Docker tags based on the following events/attributes + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + + # setup docker build + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Inspect Builder + run: | + echo "Name: ${{ steps.buildx.outputs.name }}" + echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}" + echo "Status: ${{ steps.buildx.outputs.status }}" + echo "Flags: ${{ steps.buildx.outputs.flags }}" + echo "Platforms: ${{ steps.buildx.outputs.platforms }}" + + # login to registries + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # build the docker images + - name: Build and push ${{ matrix.name }} + uses: docker/build-push-action@v6 + with: + context: ${{ matrix.CONTEXT }} + file: ${{ matrix.DOCKERFILE }} + push: true + platforms: ${{ matrix.PLATFORM }} + cache-from: type=registry,ref=pecan/${{ matrix.IMAGE }}:buildcache + cache-to: type=registry,ref=pecan/${{ matrix.IMAGE }}:buildcache,mode=max + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + VERSION=${{ steps.meta.outputs.version }} + R_VERSION=${{ env.R_VERSION }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 02d91c209b6..bf24c71812d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,17 +13,21 @@ For more information about this file see also [Keep a Changelog](http://keepacha - Refactor `convert_input` to Perform tasks via helper function. Subtask of [#3307](https://github.com/PecanProject/pecan/issues/3307) ### Fixed +- updated github action to build docker images ### Changed + - The following components have changed their licensing. With approval of all their contributors, we now provide them under a BSD 3-clause license rather than the previously used NCSA Open Source license. As a reminder, we intend to relicense the entire system and this list will expand as we gather permission from the relevant copyright owners. * `apps/api` - * Shiny apps `dbsync`, `Data-Ingest`, `Elicitation`, `ForecastingDashboard`, `global-sensitivity`, `Pecan.depend`, and `SDAdashboard` - * Base packages `PEcAn.all`, `PEcAn.QAQC`, `PEcAn.remote`, `PEcAn.settings`, and `PEcAn.workflow` - * Model packages `PEcAn.BASGRA`, `PEcAn.dvmdostem`, `PEcAn.FATES`, `PEcAn.GDAY`, `PEcAn.LDNDC`, `PEcAn.MAAT`, `PEcAn.MAESPA`, `PEcAn.SIBCASA`, `PEcAn.STICS`, and the new model package template. - * Modules `PEcAn.data.mining`, `PEcAn.emulator`, amd `PEcAn.RTM`. + * Shiny apps `dbsync`, `BenchmarkReport`, `Data-Ingest`, `Elicitation`, `ForecastingDashboard`, `global-sensitivity`, `Pecan.depend`, `SDAdashboard`, and `ViewMet` + * Base packages `PEcAn.all`, `PEcAn.DB`, `PEcAn.QAQC`, `PEcAn.remote`, `PEcAn.settings`, `PEcAn.visualization`, and `PEcAn.workflow` + * Model packages `PEcAn.BASGRA`, `PEcAn.CLM45`, `PEcAn.DALEC`, `PEcAn.dvmdostem`, `PEcAn.FATES`, `PEcAn.GDAY`, `PEcAn.JULES`, `PEcAn.LDNDC`, `PEcAn.LINKAGES`, `PEcAn.LPJGUESS`, `PEcAn.MAAT`, `PEcAn.MAESPA`, `PEcAn.PRELES`, `PEcAn.SIBCASA`, `PEcAn.SIPNET`, `PEcAn.STICS`, and the new model package template. + * Modules `PEcAn.allometry`, `PEcAn.assim.batch`, `PEcAn.data.mining`, `PEcAn.emulator`, `PEcAn.MA`, `PEcAn.photosynthesis`, `PEcAn.priors`, and `PEcAn.RTM`. +- Renamed master branch to main ### Removed +- Remove Browndog support for conversions (#3348, @Sweetdevil144). ## [1.8.0] - 2024-07-12 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d1118f69680..eb1ce470e0a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,7 +45,7 @@ Switch pecan to your fork git remote set-url origin https://github.com//pecan.git ``` -Setup pecan to be able to fetch from the master/develop +Setup pecan to be able to fetch from the main/develop ```bash git remote add upstream https://github.com/PecanProject/pecan.git @@ -53,13 +53,13 @@ git remote add upstream https://github.com/PecanProject/pecan.git ## PEcAn Branches -PEcAn uses two protected branches, the master branch and the develop branch. The master branch will match the official releases, but all work will be done on the develop branch. Make sure that you create branches from the develop branch. This should be the default branch in your git repository. +PEcAn uses two protected branches, the main branch and the develop branch. The main branch will match the official releases, but all work will be done on the develop branch. Make sure that you create branches from the develop branch. This should be the default branch in your git repository. ## Adding Features When you add a new feature always create an issue first, this allows others to comment and give you tips. It will also help us keep track of what people are adding and with new releases helps us to write new release notes and give you credit for your work. -Secondly always work in a branch, never work on the master or develop branch. Keep your master and develop branch in sync with the master and develop of the official PEcAn repository. This makes the pull requests (you do want your work to be in the main branch right?) easier for us. +Secondly always work in a branch, never work on the main or develop branch. Keep your main and develop branch in sync with the main and develop of the official PEcAn repository. This makes the pull requests (you do want your work to be in the main branch right?) easier for us. Finally try to keep your branches focused on fixing/adding only one feature and try not fall in the trap of doing a lot of things in a single branch. This will not only make it harder for us to process your pull request but makes it take longer before you can submit your pull request. Small pull requests are more likely to be looked at faster and pulled into the develop branch faster. @@ -112,7 +112,7 @@ git push -u origin GH-issuenumber-title-of-issue ## Additional Resources -- [Adding models to PEcAn](https://pecanproject.github.io/pecan-documentation/master/adding-an-ecosystem-model.html) -- [PEcAn configuration files](https://pecanproject.github.io/pecan-documentation/master/pecan-xml-configuration.html) -- [Development help](https://pecanproject.github.io/pecan-documentation/master/developer-guide.html) -- [PEcAn Code of Conduct](https://pecanproject.github.io/pecan-documentation/master/contributor-covenant-code-of-conduct.html) +- [Adding models to PEcAn](https://pecanproject.github.io/pecan-documentation/latest/adding-an-ecosystem-model.html) +- [PEcAn configuration files](https://pecanproject.github.io/pecan-documentation/latest/pecan-xml-configuration.html) +- [Development help](https://pecanproject.github.io/pecan-documentation/latest/developer-guide.html) +- [PEcAn Code of Conduct](CODE_OF_CONDUCT.md) diff --git a/DEV-INTRO.md b/DEV-INTRO.md index 465a071f9ff..59bde74b01a 100644 --- a/DEV-INTRO.md +++ b/DEV-INTRO.md @@ -1,6 +1,6 @@ # PEcAn Development -This is a minimal guide to getting started with PEcAn development under Docker. You can find more information about docker in the [pecan documentation](https://pecanproject.github.io/pecan-documentation/master/docker-index.html). +This is a minimal guide to getting started with PEcAn development under Docker. You can find more information about docker in the [pecan documentation](https://pecanproject.github.io/pecan-documentation/latest/docker-index.html). ## Requirements and Recommendations @@ -29,7 +29,7 @@ cd pecan ## Developing in Docker -The use of Docker in PEcAn is described in detail in the [PEcAn documentation](https://pecanproject.github.io/pecan-documentation/master/docker-index.html). This is intended as a quick start. +The use of Docker in PEcAn is described in detail in the [PEcAn documentation](https://pecanproject.github.io/pecan-documentation/latest/docker-index.html). This is intended as a quick start. ### Installing Docker @@ -61,7 +61,7 @@ You can now use the command `docker compose` to work with the containers setup f ### First time setup -The steps in this section only need to be done the first time you start working with the stack in docker. After this is done you can skip these steps. You can find more detail about the docker commands in the [pecan documentation](https://pecanproject.github.io/pecan-documentation/master/docker-index.html). +The steps in this section only need to be done the first time you start working with the stack in docker. After this is done you can skip these steps. You can find more detail about the docker commands in the [pecan documentation](https://pecanproject.github.io/pecan-documentation/latest/docker-index.html). - setup .env file - create folders to hold the data diff --git a/LICENSE b/LICENSE index 69b3e155809..91ed7f17c2b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,39 @@ -## This is the master copy of the PEcAn License +All portions of the PEcAn project not marked otherwise are distributed under the BSD 3-clause license: -University of Illinois/NCSA Open Source License +Copyright (c) 2012-2024 Pecan Project + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors +may be used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + + +---------------------------------- + + +Portions of the PEcAn project are distributed under the University of Illinois/NCSA Open Source License: Copyright (c) 2012, University of Illinois, NCSA. All rights reserved. @@ -36,33 +69,3 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. -------------------- - - -Portions of the PEcAn project are distributed under the BSD 3-clause license: - -Copyright (c) 2024 Pecan Project - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation -and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors -may be used to endorse or promote products derived from this software without -specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Makefile.depends b/Makefile.depends index b78fbb4052a..9ae925d43e2 100644 --- a/Makefile.depends +++ b/Makefile.depends @@ -35,6 +35,6 @@ $(call depends,modules/data.atmosphere): | .install/base/db .install/base/logger $(call depends,modules/data.land): | .install/base/db .install/base/logger .install/base/remote .install/base/settings .install/base/utils .install/base/visualization .install/modules/benchmark $(call depends,modules/data.remote): | .install/base/db .install/base/logger .install/base/remote .install/base/utils $(call depends,modules/meta.analysis): | .install/base/db .install/base/logger .install/base/settings .install/base/utils -$(call depends,modules/priors): | .install/base/logger .install/base/visualization .install/modules/meta.analysis +$(call depends,modules/priors): | .install/base/logger .install/base/utils .install/base/visualization .install/modules/meta.analysis $(call depends,modules/rtm): | .install/base/logger .install/base/utils .install/models/ed .install/modules/assim.batch $(call depends,modules/uncertainty): | .install/base/db .install/base/logger .install/base/settings .install/base/utils .install/modules/emulator .install/modules/priors diff --git a/README.md b/README.md index 06b84f1e938..c30370067e5 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ PEcAn is not itself an ecosystem model, and it can be used to with a variety of ## Documentation -Consult documentation of the PEcAn Project; either the [latest stable development](https://pecanproject.github.io/pecan-documentation/develop/) branch, the latest [release](https://pecanproject.github.io/pecan-documentation/master/). Documentation from [earlier releases is here](https://pecanproject.github.io/documentation.html). +Consult documentation of the PEcAn Project; either the [latest stable development](https://pecanproject.github.io/pecan-documentation/develop/) branch, the latest [release](https://pecanproject.github.io/pecan-documentation/latest/). Documentation from [earlier releases is here](https://pecanproject.github.io/documentation.html). ## Getting Started diff --git a/apps/api/Dockerfile b/apps/api/Dockerfile index 4aa5a6a2d9a..059e14f0c0c 100644 --- a/apps/api/Dockerfile +++ b/apps/api/Dockerfile @@ -6,7 +6,6 @@ ARG IMAGE_VERSION="latest" # PECAN FOR MODEL BASE IMAGE # -------------------------------------------------------------------------- FROM pecan/base:${IMAGE_VERSION} -LABEL maintainer="Tezan Sahu " EXPOSE 8000 @@ -15,9 +14,7 @@ EXPOSE 8000 # -------------------------------------------------------------------------- # COMMAND TO RUN -RUN --mount=type=secret,id=github_token \ - export GITHUB_PAT=`cat /run/secrets/github_token` \ - && apt-get update \ +RUN apt-get update \ && apt-get install libsodium-dev -y \ && rm -rf /var/lib/apt/lists/* \ && Rscript -e "devtools::install_version('promises', '1.1.0')" \ @@ -35,7 +32,6 @@ ENV AUTH_REQ="TRUE" \ SECRET_KEY_BASE="thisisnotasecret" WORKDIR /api/R - -CMD Rscript entrypoint.R - COPY ./ /api + +CMD ["Rscript", "entrypoint.R"] diff --git a/base/db/DESCRIPTION b/base/db/DESCRIPTION index 73a564a8a7f..76b55aed168 100644 --- a/base/db/DESCRIPTION +++ b/base/db/DESCRIPTION @@ -40,7 +40,6 @@ Description: The Predictive Ecosystem Carbon Analyzer (PEcAn) is a scientific streamline the interaction between data and models, and to improve the efficacy of scientific investigation. Imports: - curl, DBI, dbplyr (>= 2.4.0), dplyr (>= 1.1.2), @@ -59,7 +58,6 @@ Imports: tibble, tidyr, units, - XML Suggests: bit64, data.table, diff --git a/base/db/LICENSE b/base/db/LICENSE index 9e38c2dc685..09ef35a60b4 100644 --- a/base/db/LICENSE +++ b/base/db/LICENSE @@ -1,29 +1,3 @@ -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. - +YEAR: 2024 +COPYRIGHT HOLDER: PEcAn Project +ORGANIZATION: PEcAn Project, authors affiliations diff --git a/base/db/NEWS.md b/base/db/NEWS.md index fec3739e5f0..5d008066052 100644 --- a/base/db/NEWS.md +++ b/base/db/NEWS.md @@ -1,5 +1,7 @@ # PEcAn.DB 1.8.0.9000 +## License change +* PEcAn.DB is now distributed under the BSD three-clause license instead of the NCSA Open Source license. # PEcAn.DB 1.8.0 diff --git a/base/db/R/assign.treatments.R b/base/db/R/assign.treatments.R index d75f6b20b3a..3779d327676 100644 --- a/base/db/R/assign.treatments.R +++ b/base/db/R/assign.treatments.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - -##-----------------------------------------------------------------------------# ##' Change treatments to sequential integers ##' ##' Assigns all control treatments the same value, then assigns unique treatments diff --git a/base/db/R/check.lists.R b/base/db/R/check.lists.R index 18e7c8b3840..cc131ca59ed 100644 --- a/base/db/R/check.lists.R +++ b/base/db/R/check.lists.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - -##--------------------------------------------------------------------------------------------------# ##' Check two lists. Identical does not work since one can be loaded ##' from the database and the other from a CSV file. ##' diff --git a/base/db/R/convert_input.R b/base/db/R/convert_input.R index 9cc5c8f3c03..8828d069d6c 100644 --- a/base/db/R/convert_input.R +++ b/base/db/R/convert_input.R @@ -45,7 +45,6 @@ ##' @param host Named list identifying the machine where conversion should be performed. ##' Currently only \code{host$name} and \code{host$Rbinary} are used by \code{convert_input}, ##' but the whole list is passed to other functions -##' @param browndog List of information related to browndog conversion. NULL if browndog is not to be used for conversion ##' @param write Logical: Write new file records to the database? ##' @param format.vars Passed on as arguments to \code{fcn} ##' @param overwrite Logical: If a file already exists, create a fresh copy? Passed along to fcn. @@ -77,7 +76,6 @@ convert_input <- fcn, con = con, host, - browndog, write = TRUE, format.vars, overwrite = FALSE, @@ -529,105 +527,7 @@ convert_input <- conversion <- "local.remote" #default - if (!is.null(browndog) && host$name == "localhost") { - # perform conversions with Brown Dog - only works locally right now - - # Determine outputtype using formatname and mimetype of output file Add issue to - # github that extension of formats table to include outputtype Convert to netcdf - # - only using localhost - if (mimetype == "application/x-netcdf") { - outputtype <- "pecan.zip" - } else { - # Convert to model specific format - if (formatname == "ed.met_driver_header_files_format" || formatname == - "ed.met_driver_header files format") { - outputtype <- "ed.zip" - } else if (formatname == "Sipnet.climna") { - outputtype <- "clim" - } else if (formatname == "DALEC meteorology") { - outputtype <- "dalec.dat" - } else if (formatname == "LINKAGES met") { - outputtype <- "linkages.dat" - } else { - PEcAn.logger::logger.severe(paste("Unknown formatname", formatname)) - } - } - - # create curl options - curloptions <- list(followlocation = TRUE) - if (!is.null(browndog$username) && !is.null(browndog$password)) { - curloptions$userpwd = paste( - browndog$username, browndog$password, sep = ":") - curloptions$httpauth = 1L - } - - # check if we can do conversion - h <- curl::new_handle() - curl::handle_setopt(h, .list = curloptions) - out.html <- readLines( - curl::curl( - url = paste0( - "http://dap-dev.ncsa.illinois.edu:8184/inputs/", - browndog$inputtype), - handle = h)) - if (outputtype %in% out.html) { - PEcAn.logger::logger.info( - "Conversion from", browndog$inputtype, - "to", outputtype, - "through Brown Dog") - conversion <- "browndog" - } - } - - if (conversion == "browndog") { - url <- file.path(browndog$url, outputtype) - - # loop over files in localhost and zip to send to Brown Dog - files <- list.files(dbfile$file_path, pattern = dbfile$file_name) - files <- grep(dbfile$file_name, files, value = TRUE) - zipfile <- paste0(dbfile$file_name, ".", browndog$inputtype) - system(paste("cd", dbfile$file_path, "; zip", zipfile, paste(files, collapse = " "))) - zipfile <- file.path(dbfile$file_path, zipfile) - - # check for and create output folder - if (!file.exists(outfolder)) { - dir.create(outfolder, showWarnings = FALSE, recursive = TRUE) - } - - # post zipped file to Brown Dog - h <- curl::new_handle() - curl::handle_setopt(handle = h, .list = curloptions) - curl::handle_setform(handle = h, fileData = curl::form_file(zipfile)) - html <- readLines(curl::curl(url = url, handle = h)) - link <- XML::getHTMLLinks(html) - file.remove(zipfile) - - # download converted file - outfile <- file.path(outfolder, unlist(strsplit(basename(link), "_"))[2]) - PEcAn.utils::download.url(url = link, file = outfile, timeout = 600, .opts = curloptions, retry = TRUE) - - # unzip downloaded file if necessary - if (file.exists(outfile)) { - if (utils::tail(unlist(strsplit(outfile, "[.]")), 1) == "zip") { - fname <- utils::unzip(outfile, list = TRUE)$Name - utils::unzip(outfile, files = fname, exdir = outfolder, overwrite = TRUE) - file.remove(outfile) - } else { - fname <- list.files(outfolder) - } - } - - result <- data.frame( - # contains one row for each file in fname - file = file.path(outfolder, fname), - host = PEcAn.remote::fqdn(), - mimetype = mimetype, - formatname = formatname, - startdate = paste(input$start_date, "00:00:00"), - enddate = paste(input$end_date, "23:59:59"), - stringsAsFactors = FALSE) - - } else if (conversion == "local.remote") { + if (conversion == "local.remote") { # perform conversion on local or remote host fcn.args <- input.args diff --git a/base/db/R/covariate.functions.R b/base/db/R/covariate.functions.R index 31c93009ee9..c40e3ca5a05 100644 --- a/base/db/R/covariate.functions.R +++ b/base/db/R/covariate.functions.R @@ -1,12 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - ######################## COVARIATE FUNCTIONS ################################# ##--------------------------------------------------------------------------------------------------# diff --git a/base/db/R/dbfiles.R b/base/db/R/dbfiles.R index e0f9556779b..4214c06837b 100644 --- a/base/db/R/dbfiles.R +++ b/base/db/R/dbfiles.R @@ -1,12 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - ##' Function to insert a file into the dbfiles table as an input ##' ##' This will write into the dbfiles, inputs, machines and formats the required diff --git a/base/db/R/derive.trait.R b/base/db/R/derive.trait.R index 7abc5b9cc64..01264b25e5e 100644 --- a/base/db/R/derive.trait.R +++ b/base/db/R/derive.trait.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - -##--------------------------------------------------------------------------------------------------# ##' ##' Performs an arithmetic function, FUN, over a series of traits and returns ##' the result as a derived trait. diff --git a/base/db/R/derive.traits.R b/base/db/R/derive.traits.R index c5b8be9e7ec..cb8265149ab 100644 --- a/base/db/R/derive.traits.R +++ b/base/db/R/derive.traits.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - -##--------------------------------------------------------------------------------------------------# ##' Equivalent to derive.trait(), but operates over a series of trait datasets, ##' as opposed to individual trait rows. See \code{\link{derive.trait}}; for more information. ##' diff --git a/base/db/R/fetch.stats2se.R b/base/db/R/fetch.stats2se.R index 7425399f3c3..d0bad8ae465 100644 --- a/base/db/R/fetch.stats2se.R +++ b/base/db/R/fetch.stats2se.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - -##--------------------------------------------------------------------------------------------------# ##' Queries data from the trait database and transforms statistics to SE ##' ##' Performs query and then uses \code{transformstats} to convert miscellaneous statistical summaries diff --git a/base/db/R/get.trait.data.R b/base/db/R/get.trait.data.R index f181856639c..b307da08c0b 100644 --- a/base/db/R/get.trait.data.R +++ b/base/db/R/get.trait.data.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - -##--------------------------------------------------------------------------------------------------# ##' Get trait data from the database. ##' ##' This will use the following items from settings: diff --git a/base/db/R/get.trait.data.pft.R b/base/db/R/get.trait.data.pft.R index 5556930d449..a2af9c5215a 100644 --- a/base/db/R/get.trait.data.pft.R +++ b/base/db/R/get.trait.data.pft.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - -##--------------------------------------------------------------------------------------------------# ##' Get trait data from the database for a single PFT ##' ##' @details `pft` should be a list containing at least `name` and `outdir`, and optionally `posteriorid` and `constants`. BEWARE: All existing files in `outir` will be deleted! diff --git a/base/db/R/pft.add.spp.R b/base/db/R/pft.add.spp.R index ce8cf1c3b10..0193aae9c5a 100644 --- a/base/db/R/pft.add.spp.R +++ b/base/db/R/pft.add.spp.R @@ -1,11 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- ## M. Dietze ##' adds a list of species to a pft based on USDA Plants acronyms ##' diff --git a/base/db/R/query.data.R b/base/db/R/query.data.R index bed236305af..73ca64a7b81 100644 --- a/base/db/R/query.data.R +++ b/base/db/R/query.data.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - -##--------------------------------------------------------------------------------------------------# ##' Function to query data from database for specific species and convert stat to SE ##' ##' @name query.data diff --git a/base/db/R/query.pft.R b/base/db/R/query.pft.R index 3a4b231953f..1c45f215622 100644 --- a/base/db/R/query.pft.R +++ b/base/db/R/query.pft.R @@ -1,12 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- -#--------------------------------------------------------------------------------------------------# ##' select plant id's associated with pft ##' ##' @title Query species given pft name diff --git a/base/db/R/query.prior.R b/base/db/R/query.prior.R index 736565641f7..6c078dd8aa4 100644 --- a/base/db/R/query.prior.R +++ b/base/db/R/query.prior.R @@ -1,12 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- -#--------------------------------------------------------------------------------------------------# ##' Query Priors ##' ##' Query priors associated with a plant functional type and a set of traits. diff --git a/base/db/R/query.trait.data.R b/base/db/R/query.trait.data.R index 3162372f0f5..e55b781ab9b 100644 --- a/base/db/R/query.trait.data.R +++ b/base/db/R/query.trait.data.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - -##--------------------------------------------------------------------------------------------------# ##' Extract trait data from database ##' ##' Extracts data from database for a given trait and set of species, diff --git a/base/db/R/query.traits.R b/base/db/R/query.traits.R index 5b4dab14c68..0d7f54815a1 100644 --- a/base/db/R/query.traits.R +++ b/base/db/R/query.traits.R @@ -1,12 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- -#------------------------------------------------------------------------------# ##' Query available trait data associated with a given pft and a list of traits ##' ##' @name query.traits diff --git a/base/db/R/query.yields.R b/base/db/R/query.yields.R index 4f07ef01b74..dfaef5956dc 100644 --- a/base/db/R/query.yields.R +++ b/base/db/R/query.yields.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - -##--------------------------------------------------------------------------------------------------# ##' Function to query yields data from database for specific species and convert stat to SE ##' ##' @name query.yields diff --git a/base/db/R/symmetric_setdiff.R b/base/db/R/symmetric_setdiff.R index 1056ec0b5fd..9f8b2f146dd 100644 --- a/base/db/R/symmetric_setdiff.R +++ b/base/db/R/symmetric_setdiff.R @@ -1,12 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - #' Symmetric set difference of two data frames #' #' @param x,y `data.frame`s to compare diff --git a/base/db/R/take.samples.R b/base/db/R/take.samples.R index aa755a7e45e..06507a2cfba 100644 --- a/base/db/R/take.samples.R +++ b/base/db/R/take.samples.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - -##-----------------------------------------------------------------------------# ##' sample from normal distribution, given summary stats ##' ##' @name take.samples diff --git a/base/db/R/utils_db.R b/base/db/R/utils_db.R index 938b504e294..f59a9c3c2fe 100644 --- a/base/db/R/utils_db.R +++ b/base/db/R/utils_db.R @@ -1,11 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- .db.utils <- new.env() .db.utils$created <- 0 diff --git a/base/db/man/convert_input.Rd b/base/db/man/convert_input.Rd index 12197aecd74..466e46b73a3 100644 --- a/base/db/man/convert_input.Rd +++ b/base/db/man/convert_input.Rd @@ -16,7 +16,6 @@ convert_input( fcn, con = con, host, - browndog, write = TRUE, format.vars, overwrite = FALSE, @@ -56,8 +55,6 @@ convert_input( Currently only \code{host$name} and \code{host$Rbinary} are used by \code{convert_input}, but the whole list is passed to other functions} -\item{browndog}{List of information related to browndog conversion. NULL if browndog is not to be used for conversion} - \item{write}{Logical: Write new file records to the database?} \item{format.vars}{Passed on as arguments to \code{fcn}} diff --git a/base/db/tests/testthat.R b/base/db/tests/testthat.R index d2515cd48b8..03f6b840cbf 100644 --- a/base/db/tests/testthat.R +++ b/base/db/tests/testthat.R @@ -1,11 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- library(testthat) library(PEcAn.DB) diff --git a/base/db/tests/testthat/test.contents_sanity.R b/base/db/tests/testthat/test.contents_sanity.R index 6b1ad0eee85..9a11d2bb7ae 100644 --- a/base/db/tests/testthat/test.contents_sanity.R +++ b/base/db/tests/testthat/test.contents_sanity.R @@ -1,11 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- context("Basic Sanity tests for PEcAn functions that query BETYdb") test_that("append.covariates appends managements to yields",{ con <- check_db_test() diff --git a/base/db/tests/testthat/test.convert_input.R b/base/db/tests/testthat/test.convert_input.R index cd33523f86c..e4f40e7bcb5 100644 --- a/base/db/tests/testthat/test.convert_input.R +++ b/base/db/tests/testthat/test.convert_input.R @@ -34,7 +34,6 @@ test_that("`convert_input()` able to call the respective download function for a fcn = "download.AmerifluxLBL", con = NULL, host = data.frame(name = "localhost"), - browndog = NULL, write = FALSE, lat.in = 40, lon.in = -88 diff --git a/base/db/tests/testthat/test.db.utils.R b/base/db/tests/testthat/test.db.utils.R index 85e4b17a661..7d8839357e2 100644 --- a/base/db/tests/testthat/test.db.utils.R +++ b/base/db/tests/testthat/test.db.utils.R @@ -1,11 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- context("Testing utility functions") test_that("get.id works on some tables, and with different inputs", { diff --git a/base/db/tests/testthat/test.derive.traits.R b/base/db/tests/testthat/test.derive.traits.R index 4ba88caf3ed..b389b401f31 100644 --- a/base/db/tests/testthat/test.derive.traits.R +++ b/base/db/tests/testthat/test.derive.traits.R @@ -1,12 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - test_that("derive.traits works",{ set.seed(0) input <- list(x = data.frame(mean = 1, stat = 1, n = 1)) diff --git a/base/db/tests/testthat/test.query.base.R b/base/db/tests/testthat/test.query.base.R index 43f60555bd2..301d10b7c90 100644 --- a/base/db/tests/testthat/test.query.base.R +++ b/base/db/tests/testthat/test.query.base.R @@ -1,11 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- context("test db.query") test_that("db.query can execute a trivial SQL statement and return results",{ diff --git a/base/settings/R/addSecrets.R b/base/settings/R/addSecrets.R index b6eb2e7c5c3..65f7bc6f415 100644 --- a/base/settings/R/addSecrets.R +++ b/base/settings/R/addSecrets.R @@ -3,7 +3,7 @@ #' Copies certains sections from ~/.pecan.xml to the settings. This allows #' a user to have their own unique parameters also when sharing the #' pecan.xml file we don't expose these secrets. -#' Currently this will copy the database and browndog sections +#' Currently this will copy the database sections #' #' @title Add Users secrets #' @param settings settings file @@ -44,19 +44,6 @@ addSecrets <- function(settings, force = FALSE) { } } - # only copy these sections if tag exists - for (key in c("browndog")) { - if (! key %in% names(settings)) next - - for (section in names(pecan[[key]])) { - if (section %in% names(settings[section])) { - PEcAn.logger::logger.info("Already have a section for", section) - } else { - PEcAn.logger::logger.info("Imported section for", section) - settings[[key]][section] <- pecan[[key]][section] - } - } - } return(invisible(settings)) } diff --git a/base/settings/man/addSecrets.Rd b/base/settings/man/addSecrets.Rd index 7bc2ae7783b..e3366eda13c 100644 --- a/base/settings/man/addSecrets.Rd +++ b/base/settings/man/addSecrets.Rd @@ -21,7 +21,7 @@ Add secret information from ~/.pecan.xml Copies certains sections from ~/.pecan.xml to the settings. This allows a user to have their own unique parameters also when sharing the pecan.xml file we don't expose these secrets. -Currently this will copy the database and browndog sections +Currently this will copy the database sections } \author{ Rob Kooper diff --git a/base/settings/tests/testthat/test.addSecrets.R b/base/settings/tests/testthat/test.addSecrets.R index e7fa1fa8729..f683f135877 100644 --- a/base/settings/tests/testthat/test.addSecrets.R +++ b/base/settings/tests/testthat/test.addSecrets.R @@ -40,8 +40,7 @@ test_that("`addSecrets` adds secret settings when force is FALSE and secrets hav settings <- list( settings.info = list( secrets.added = FALSE - ), - browndog = list() + ) ) mocked_xmlToList_result <- list( @@ -50,11 +49,6 @@ test_that("`addSecrets` adds secret settings when force is FALSE and secrets hav name = "pecan", password = "pecan" ) - ), - browndog = list( - section = list( - name = "pecan" - ) ) ) mockery::stub(addSecrets, 'file.exists', TRUE) @@ -62,5 +56,4 @@ test_that("`addSecrets` adds secret settings when force is FALSE and secrets hav updated_settings <- addSecrets(settings, force = FALSE) expect_equal(updated_settings$database$section$name, "pecan") expect_equal(updated_settings$database$section$password, "pecan") - expect_equal(updated_settings$browndog$section$name, "pecan") }) \ No newline at end of file diff --git a/base/utils/NAMESPACE b/base/utils/NAMESPACE index 300bd155fbb..2f8d208fcec 100644 --- a/base/utils/NAMESPACE +++ b/base/utils/NAMESPACE @@ -60,6 +60,7 @@ export(ud_convert) export(unit_is_parseable) export(units_are_equivalent) export(vecpaste) +export(zero.bounded.density) export(zero.truncate) importFrom(magrittr,"%>%") importFrom(rlang,.data) diff --git a/base/utils/NEWS.md b/base/utils/NEWS.md index ffb7115a717..2832fad34ff 100644 --- a/base/utils/NEWS.md +++ b/base/utils/NEWS.md @@ -1,5 +1,7 @@ # PEcAn.utils 1.8.0.9000 +## Added +* utility function `zero.bounded.density` is now exported. # PEcAn.utils 1.8.0 diff --git a/base/utils/R/utils.R b/base/utils/R/utils.R index 5e13ddedf1a..e7e0381f146 100644 --- a/base/utils/R/utils.R +++ b/base/utils/R/utils.R @@ -186,6 +186,7 @@ get.run.id <- function(run.type, index, trait = NULL, pft.name = NULL, site.id=N ##' @return data frame with back-transformed log density estimate ##' @author \href{https://stats.stackexchange.com/q/6588/2750}{Rob Hyndman} ##' @references M. P. Wand, J. S. Marron and D. Ruppert, 1991. Transformations in Density Estimation. Journal of the American Statistical Association. 86(414):343-353 \url{http://www.jstor.org/stable/2290569} +##' @export zero.bounded.density <- function(x, bw = "SJ", n = 1001) { y <- log(x) g <- stats::density(y, bw = bw, n = n) diff --git a/base/utils/tests/testthat/data/config.example.php b/base/utils/tests/testthat/data/config.example.php index 653cd64fcfb..fd2e5af4b41 100644 --- a/base/utils/tests/testthat/data/config.example.php +++ b/base/utils/tests/testthat/data/config.example.php @@ -16,10 +16,6 @@ $db_fia_password=""; $db_fia_database=""; -# browdog information -$browndog_url=""; -$browndog_username=""; -$browndog_password=""; # R binary $Rbinary="/usr/bin/R"; diff --git a/base/visualization/LICENSE b/base/visualization/LICENSE index 5a9e44128f1..09ef35a60b4 100644 --- a/base/visualization/LICENSE +++ b/base/visualization/LICENSE @@ -1,34 +1,3 @@ -## This is the master copy of the PEcAn License - -University of Illinois/NCSA Open Source License - -Copyright (c) 2012, University of Illinois, NCSA. All rights reserved. - -PEcAn project -www.pecanproject.org - -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. - +YEAR: 2024 +COPYRIGHT HOLDER: PEcAn Project +ORGANIZATION: PEcAn Project, authors affiliations diff --git a/base/visualization/NEWS.md b/base/visualization/NEWS.md new file mode 100644 index 00000000000..04eb05d89a1 --- /dev/null +++ b/base/visualization/NEWS.md @@ -0,0 +1,11 @@ +# PEcAn.visualization 1.8.0.9000 + +## License change +* PEcAn.visualization is now distributed under the BSD three-clause license instead of the NCSA Open Source license. + + +# PEcAn.visualization 1.7.1 + +* All changes in 1.7.1 and earlier were recorded in a single file for all of + the PEcAn packages; please see + https://github.com/PecanProject/pecan/blob/v1.7.1/CHANGELOG.md for details. diff --git a/base/visualization/R/plot_netcdf.R b/base/visualization/R/plot_netcdf.R index 1dcdcac74cd..451e4d89f7f 100644 --- a/base/visualization/R/plot_netcdf.R +++ b/base/visualization/R/plot_netcdf.R @@ -1,12 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - # ---------------------------------------------------------------------- # PRIVATE FUNCTIONS # ---------------------------------------------------------------------- diff --git a/base/visualization/R/plots.R b/base/visualization/R/plots.R index 85b6534142f..40bebb9510a 100644 --- a/base/visualization/R/plots.R +++ b/base/visualization/R/plots.R @@ -1,12 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - ##' Variable-width (diagonally cut) histogram ##' ##' When constructing a histogram, it is common to make all bars the same width. diff --git a/base/visualization/tests/testthat.R b/base/visualization/tests/testthat.R index d296184d0f0..461fd30776d 100644 --- a/base/visualization/tests/testthat.R +++ b/base/visualization/tests/testthat.R @@ -1,11 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- library(testthat) library(PEcAn.visualization) diff --git a/base/visualization/tests/testthat/test.viz.R b/base/visualization/tests/testthat/test.viz.R index 3dffbdd7ca8..d205843a58e 100644 --- a/base/visualization/tests/testthat/test.viz.R +++ b/base/visualization/tests/testthat/test.viz.R @@ -1,11 +1,3 @@ -## ------------------------------------------------------------------------------- -## Copyright (c) 2012 University of Illinois, NCSA. -## All rights reserved. This program and the accompanying materials -## are made available under the terms of the -## University of Illinois/NCSA Open Source License -## which accompanies this distribution, and is available at -## http://opensource.ncsa.illinois.edu/license.html -##------------------------------------------------------------------------------- context("Testing Visualization") diff --git a/base/workflow/R/do_conversions.R b/base/workflow/R/do_conversions.R index 2d886ba4cbf..50fd71e812e 100644 --- a/base/workflow/R/do_conversions.R +++ b/base/workflow/R/do_conversions.R @@ -83,7 +83,7 @@ do_conversions <- function(settings, overwrite.met = FALSE, overwrite.fia = FALS # met conversion if (input.tag == "met") { - name <- ifelse(is.null(settings$browndog), "MET Process", "BrownDog") + name <- "MET Process" if ( (PEcAn.utils::status.check(name) == 0)) { ## previously is.null(input$path) && PEcAn.logger::logger.info("calling met.process: ",settings$run$inputs[[i]][['path']]) settings$run$inputs[[i]] <- @@ -96,7 +96,6 @@ do_conversions <- function(settings, overwrite.met = FALSE, overwrite.fia = FALS host = settings$host, dbparms = settings$database$bety, dir = dbfiles, - browndog = settings$browndog, spin = settings$spin, overwrite = overwrite.met) PEcAn.logger::logger.debug("updated met path: ",settings$run$inputs[[i]][['path']]) diff --git a/book_source/02_demos_tutorials_workflows/01_install_pecan.Rmd b/book_source/02_demos_tutorials_workflows/01_install_pecan.Rmd index eb26d63e729..1d038862542 100644 --- a/book_source/02_demos_tutorials_workflows/01_install_pecan.Rmd +++ b/book_source/02_demos_tutorials_workflows/01_install_pecan.Rmd @@ -81,7 +81,7 @@ This will not go into much detail about about how to use Docker -- for more deta This should print the current version of docker-compose. We have tested the instruction below with versions of docker compose 1.22 and above. -3. **Download the PEcAn docker compose file**. It is located in the root directory of the [PEcAn source code](https://github.com/pecanproject/pecan). For reference, here are direct links to the [latest stable version](https://raw.githubusercontent.com/PecanProject/pecan/master/docker-compose.yml) and the [bleeding edge development version](https://raw.githubusercontent.com/PecanProject/pecan/develop/docker-compose.yml). (To download the files, you should be able to right click the link and select "Save link as".) Make sure the file is saved as `docker-compose.yml` in a directory called `pecan`. +3. **Download the PEcAn docker compose file**. It is located in the root directory of the [PEcAn source code](https://github.com/pecanproject/pecan). For reference, here are direct links to the [latest stable version](https://raw.githubusercontent.com/PecanProject/pecan/main/docker-compose.yml) and the [bleeding edge development version](https://raw.githubusercontent.com/PecanProject/pecan/develop/docker-compose.yml). (To download the files, you should be able to right click the link and select "Save link as".) Make sure the file is saved as `docker-compose.yml` in a directory called `pecan`. 4. **Initialize the PEcAn database and data images**. The following `docker compose` commands are used to download all the data PEcAn needs to start working. For more on how they work, see our [Docker topical pages](#pecan-docker-quickstart-init). diff --git a/book_source/02_demos_tutorials_workflows/02_user_demos/01_introductions_user.Rmd b/book_source/02_demos_tutorials_workflows/02_user_demos/01_introductions_user.Rmd index c9bdc0e81b9..2487ab7a9d3 100644 --- a/book_source/02_demos_tutorials_workflows/02_user_demos/01_introductions_user.Rmd +++ b/book_source/02_demos_tutorials_workflows/02_user_demos/01_introductions_user.Rmd @@ -13,16 +13,16 @@ The following Tutorials assume you have installed PEcAn. If you have not, please |Type|Title|Web Link| Source Rmd| |:--:|:---:|:------:|:---------:| |Demo| Basic Run| [html](#demo-1) | [Rmd](https://github.com/PecanProject/pecan/blob/develop/documentation/tutorials/01_Demo_Basic_Run/Demo01.Rmd)| -|Demo| Uncertainty Analysis| [html](#demo-2) | [Rmd](https://github.com/PecanProject/pecan/tree/master/documentation/tutorials/02_Demo_Uncertainty_Analysis)| +|Demo| Uncertainty Analysis| [html](#demo-2) | [Rmd](https://github.com/PecanProject/pecan/tree/main/documentation/tutorials/02_Demo_Uncertainty_Analysis)| |Demo| Output Analysis|html |[Rmd](https://github.com/PecanProject/pecan/tree/develop/documentation/tutorials/AnalyzeOutput)| |Demo| MCMC |html|[Rmd](https://github.com/PecanProject/pecan/tree/develop/documentation/tutorials/MCMC)| |Demo|Parameter Assimilation |html |[Rmd](https://github.com/PecanProject/pecan/tree/develop/documentation/tutorials/ParameterAssimilation)| |Demo|State Assimilation|html|[Rmd](https://github.com/PecanProject/pecan/tree/develop/documentation/tutorials/StateAssimilation)| |Demo| Sensitivity|html|[Rmd](https://github.com/PecanProject/pecan/tree/develop/documentation/tutorials/sensitivity)| -|Vignette|Allometries|html|[Rmd](https://github.com/PecanProject/pecan/blob/master/modules/allometry/vignettes/AllomVignette.Rmd)| -|Vignette|MCMC|html|[Rmd](https://github.com/PecanProject/pecan/blob/master/modules/assim.batch/vignettes/AssimBatchVignette.Rmd)| -|Vignette|Meteorological Data|html|[Rmd](https://github.com/PecanProject/pecan/tree/master/modules/data.atmosphere/vignettes)| -|Vignette|Meta-Analysis|html|[Rmd](https://github.com/PecanProject/pecan/blob/master/modules/meta.analysis/vignettes/single.MA_demo.Rmd)| -|Vignette|Photosynthetic Response Curves|html|[Rmd](https://github.com/PecanProject/pecan/blob/master/modules/photosynthesis/vignettes/ResponseCurves.Rmd)| -|Vignette|Priors|html|[Rmd](https://github.com/PecanProject/pecan/blob/master/modules/priors/vignettes/priors_demo.Rmd)| -|Vignette|Leaf Spectra:PROSPECT inversion|html|[Rmd](https://github.com/PecanProject/pecan/blob/master/modules/rtm/vignettes/pecanrtm.vignette.Rmd)| +|Vignette|Allometries|html|[Rmd](https://github.com/PecanProject/pecan/blob/main/modules/allometry/vignettes/AllomVignette.Rmd)| +|Vignette|MCMC|html|[Rmd](https://github.com/PecanProject/pecan/blob/main/modules/assim.batch/vignettes/AssimBatchVignette.Rmd)| +|Vignette|Meteorological Data|html|[Rmd](https://github.com/PecanProject/pecan/tree/main/modules/data.atmosphere/vignettes)| +|Vignette|Meta-Analysis|html|[Rmd](https://github.com/PecanProject/pecan/blob/main/modules/meta.analysis/vignettes/single.MA_demo.Rmd)| +|Vignette|Photosynthetic Response Curves|html|[Rmd](https://github.com/PecanProject/pecan/blob/main/modules/photosynthesis/vignettes/ResponseCurves.Rmd)| +|Vignette|Priors|html|[Rmd](https://github.com/PecanProject/pecan/blob/main/modules/priors/vignettes/priors_demo.Rmd)| +|Vignette|Leaf Spectra:PROSPECT inversion|html|[Rmd](https://github.com/PecanProject/pecan/blob/main/modules/rtm/vignettes/pecanrtm.vignette.Rmd)| diff --git a/book_source/02_demos_tutorials_workflows/02_user_demos/05_advanced_user_guide/93_workflow_curl.Rmd b/book_source/02_demos_tutorials_workflows/02_user_demos/05_advanced_user_guide/93_workflow_curl.Rmd index e9c325eebfc..9bfd6ebeee3 100644 --- a/book_source/02_demos_tutorials_workflows/02_user_demos/05_advanced_user_guide/93_workflow_curl.Rmd +++ b/book_source/02_demos_tutorials_workflows/02_user_demos/05_advanced_user_guide/93_workflow_curl.Rmd @@ -33,8 +33,6 @@ sensitivity=-1,1 pecan_edit=on # redirect to edit the model configuration files model_edit=on -# use browndog -browndog=on ``` For example the following will run the above workflow. Using -v in curl will show verbose output (needed) and the grep will make sure it only shows the redirect. This will show the actual workflowid: diff --git a/book_source/02_demos_tutorials_workflows/03_web_workflow.Rmd b/book_source/02_demos_tutorials_workflows/03_web_workflow.Rmd index 997c4d5faa0..350fd2b27c5 100644 --- a/book_source/02_demos_tutorials_workflows/03_web_workflow.Rmd +++ b/book_source/02_demos_tutorials_workflows/03_web_workflow.Rmd @@ -200,7 +200,7 @@ At the moment, what is functional is a prototype workflow that works for invento This tool works with an internal copy of the FIA that is uploaded to a postGRES database along side BETY, however for space reasons this database does not ship with the PEcAn VM. To turn this feature on: 1. Download and Install the FIA database. Instructions in [Installing data for PEcAn] -2. For web-base runs, specify the database settings in the [config.php](https://github.com/PecanProject/pecan/blob/master/web/config.example.php) +2. For web-base runs, specify the database settings in the [config.php](https://github.com/PecanProject/pecan/blob/main/web/config.example.php) 3. For R-based runs, specify the database settings in the [THE PEcAn XML] More detailed information on how PEcAn processes inputs can be found on our [Input Conversion]page. diff --git a/book_source/02_demos_tutorials_workflows/04_more_web_interface/00_intermediate_users_guide.Rmd b/book_source/02_demos_tutorials_workflows/04_more_web_interface/00_intermediate_users_guide.Rmd index 2536efe60d7..0b778b14098 100644 --- a/book_source/02_demos_tutorials_workflows/04_more_web_interface/00_intermediate_users_guide.Rmd +++ b/book_source/02_demos_tutorials_workflows/04_more_web_interface/00_intermediate_users_guide.Rmd @@ -3,7 +3,6 @@ This section will provide information to those wanting to take advantage of PEcAn's customizations from the web interface. * [Additional web configuration] - Advanced options available from the web interface - - [Brown Dog](#browndog) - [Sensitivity and ensemble analyses][Advanced Setup][TODO: Under construction...] - [Editing model configurations][TODO: Under construction...] * [Settings-configured analyses] - Analyses only available by manually editing `pecan.xml` diff --git a/book_source/02_demos_tutorials_workflows/04_more_web_interface/01_additional_web_config.Rmd b/book_source/02_demos_tutorials_workflows/04_more_web_interface/01_additional_web_config.Rmd index 6e2c20c9905..b0bd053be7b 100644 --- a/book_source/02_demos_tutorials_workflows/04_more_web_interface/01_additional_web_config.Rmd +++ b/book_source/02_demos_tutorials_workflows/04_more_web_interface/01_additional_web_config.Rmd @@ -3,7 +3,6 @@ Additional settings for web configuration: - [Web interface setup]{#intermediate-web-setup} -- [Brown Dog]{#browndog} - [Advanced setup]{#intermediate-advanced-setup} - [Sensitivity analysis] (TODO) - [Uncertainty analysis] (TODO) @@ -19,26 +18,16 @@ The list of configuration available 1. **Database configuration** : BETYdb(Biofuel Ecophysiological Traits and Yields database) configuration details, can be edited according to need. -2. **Browndog configuration** : Browndog configuration details, Used to connect browndog. Its included by default in VM. +2. **FIA Database** : FIA(Forest Inventory and Analysis) Database configuration details, Can be used to add additional data to models. -3. **FIA Database** : FIA(Forest Inventory and Analysis) Database configuration details, Can be used to add additional data to models. +3. **Google MapKey** : Google Map key, used to access the google map by PEcAn. -4. **Google MapKey** : Google Map key, used to access the google map by PEcAn. +4. **Change Password** : A small infomation to change the VM user password. (if using Docker image it won't work) -5. **Change Password** : A small infomation to change the VM user password. (if using Docker image it won't work) - -6. **Automatic Sync** : If ON then it will sync the database between local machine and the remote servers. **Still unders testing part might be buggy**. +5. **Automatic Sync** : If ON then it will sync the database between local machine and the remote servers. **Still unders testing part might be buggy**. Still work on the adding other editing feature going on, this page will be updated as new configuration will be available. -### Brown Dog {#browndog} - -The Browndog service provides PEcAn with access to large and diverse sets of data at the click of a button in the format that PEcAn needs. By clicking the checkbox you will be using the Browndog Service to process data. - -For more information regarding meteorological data check out [Available Meteorological Drivers](#met-drivers). - -More information can be found at the [Browndog website](http://browndog.ncsa.illinois.edu/). - ### Advanced Setup {#intermediate-advanced-setup} (TODO: Under construction...) diff --git a/book_source/02_demos_tutorials_workflows/05_developer_workflows/02_git/01_using-git.Rmd b/book_source/02_demos_tutorials_workflows/05_developer_workflows/02_git/01_using-git.Rmd index 3a25be86f07..c4054bde55b 100644 --- a/book_source/02_demos_tutorials_workflows/05_developer_workflows/02_git/01_using-git.Rmd +++ b/book_source/02_demos_tutorials_workflows/05_developer_workflows/02_git/01_using-git.Rmd @@ -48,7 +48,7 @@ We follow branch organization laid out on [this page](http://nvie.com/posts/a-su In short, there are three main branches you must be aware of: * **develop** - Main Branch containing the latest code. This is the main branch you will make changes to. -* **master** - Branch containing the latest stable code. DO NOT MAKE CHANGES TO THIS BRANCH. +* **main** - Branch containing the latest stable code. DO NOT MAKE CHANGES TO THIS BRANCH. * **release/vX.X.X** - Named branches containing code specific to a release. Only make changes to this branch if you are fixing a bug on a release branch. #### Milestones, Issues, Tasks @@ -121,7 +121,7 @@ git remote add upstream git@github.com:PecanProject/pecan.git ##### Hint: Keeping your fork in sync -If you have used the instructions above, you can use the helper script called [`scripts/syncgit.sh`](https://github.com/PecanProject/pecan/blob/master/scripts/syncgit.sh) to keep the master and develop branches of your own fork in sync with the PEcAnProject/pecan repository. +If you have used the instructions above, you can use the helper script called [`scripts/syncgit.sh`](https://github.com/PecanProject/pecan/blob/main/scripts/syncgit.sh) to keep the main and develop branches of your own fork in sync with the PEcAnProject/pecan repository. After following the above, your .git/config file will include the following: @@ -144,7 +144,7 @@ Then, you can run: ./scripts/syncgit.sh ``` -Now the master and develop branches on your fork will be up to date. +Now the main and develop branches on your fork will be up to date. #### Using Branching @@ -199,7 +199,7 @@ git push origin #### After pull request is merged -1. Make sure you start in master +1. Make sure you start in main ```sh git checkout develop` diff --git a/book_source/03_topical_pages/02_pecan_standards.Rmd b/book_source/03_topical_pages/02_pecan_standards.Rmd index e0146f18b8d..35703a846ef 100644 --- a/book_source/03_topical_pages/02_pecan_standards.Rmd +++ b/book_source/03_topical_pages/02_pecan_standards.Rmd @@ -10,11 +10,11 @@ Internal PEcAn standard time follows ISO_8601 format for dates and time (https:/ To aid in the conversion between PEcAn internal ISO_8601 standard and CF convention used in all met drivers and PEcAn standard output you can utilize the functions: "cf2datetime","datetime2doy","cf2doy", and for SIPNET "sipnet2datetime" -### Input Standards +## Input Standards -#### Meterology Standards +### Meteorology Standards -##### Dimensions: +#### Dimensions: |CF standard-name | units | @@ -26,7 +26,8 @@ To aid in the conversion between PEcAn internal ISO_8601 standard and CF convent General Note: dates in the database should be date-time (preferably with timezone), and datetime passed around in PEcAn should be of type POSIXct. -##### The variable names should be `standard_name` +#### Variable names should be `standard_name` + ```{r, echo=FALSE,warning=FALSE,message=FALSE} names<-c("air_temperature", "air_temperature_max", "air_temperature_min", "air_pressure", "mole_fraction_of_carbon_dioxide_in_air", "moisture_content_of_soil_layer", "soil_temperature ", @@ -75,15 +76,15 @@ The key is to process each type of met data (site, reanalysis, forecast, climate ### Soils and Vegetation Inputs -##### Soil Data +#### Soil Data See the [Soil Data] section on more into on creating a standard soil data file. -##### Vegetation Data +#### Vegetation Data See the [Vegetation Data] section on more info on creating a standard vegetation data file -### Output Standards {#OutputStandards} +## Output Standards {#OutputStandards} * created by `model2netcdf` functions * based on format used by [MsTMIP](http://nacp.ornl.gov/MsTMIP_variables.shtml) diff --git a/book_source/03_topical_pages/03_pecan_xml.Rmd b/book_source/03_topical_pages/03_pecan_xml.Rmd index 30eb369ff51..4e6e6715a6a 100644 --- a/book_source/03_topical_pages/03_pecan_xml.Rmd +++ b/book_source/03_topical_pages/03_pecan_xml.Rmd @@ -19,7 +19,6 @@ It contains the following major sections ("nodes"): - [`parameter.data.assimilation`](#xml-parameter-data-assimilation) -- Parameter data assimilation - [`multi.settings`](#xml-multi-settings) -- Multi Site Settings - (experimental) [`state.data.assimilation`](#xml-state-data-assimilation) -- State data assimilation - - (experimental) [`browndog`](#xml-browndog) -- Brown Dog configuration - (experimental) [`benchmarking`](#xml-benchmarking) -- Benchmarking - [`remote_process`](#xml-remote_process) -- Remote data module @@ -474,7 +473,7 @@ PEcAn tries to detect and throw informative errors when dates are out of bounds The following tags are optional run settings that apply to any model: -* `jobtemplate`: the template used when creating a `job.sh` file, which is used to launch the actual model. Each model has its own default template in the `inst` folder of the corresponding R package (for instance, here is the one for [ED2](https://github.com/PecanProject/pecan/blob/master/models/ed/inst/template.job)). The following variables can be used: `@SITE_LAT@`, `@SITE_LON@`, `@SITE_MET@`, `@START_DATE@`, `@END_DATE@`, `@OUTDIR@`, `@RUNDIR@` which all come variables in the `pecan.xml` file. The following two command can be used to copy and clean the results from a scratch folder (specified as scratch in the run section below, for example local disk vs network disk) : `@SCRATCH_COPY@`, `@SCRATCH_CLEAR@`. +* `jobtemplate`: the template used when creating a `job.sh` file, which is used to launch the actual model. Each model has its own default template in the `inst` folder of the corresponding R package (for instance, here is the one for [ED2](https://github.com/PecanProject/pecan/blob/main/models/ed/inst/template.job)). The following variables can be used: `@SITE_LAT@`, `@SITE_LON@`, `@SITE_MET@`, `@START_DATE@`, `@END_DATE@`, `@OUTDIR@`, `@RUNDIR@` which all come variables in the `pecan.xml` file. The following two command can be used to copy and clean the results from a scratch folder (specified as scratch in the run section below, for example local disk vs network disk) : `@SCRATCH_COPY@`, `@SCRATCH_CLEAR@`. * `stop_on_error`: (logical) Whether the workflow should immediately terminate if _any_ of the model runs fail. If unset, this defaults to `TRUE` unless you are running an ensemble simulation (and ensemble size is greater than 1). @@ -972,27 +971,6 @@ For the MODIS LAI and SMAP soil moisture observations, the `search_window` speci * **run_parallel** : [optional] This tag defines if you want to proceed the MODIS LAI function parallely, the default value is FALSE. -### (experimental) Brown Dog {#xml-browndog} - -This section describes how to connect to [Brown Dog](http://browndog.ncsa.illinois.edu). This facilitates processing and conversions of data. - -```xml - - ... - ... - ... - -``` - -* `url`: (required) endpoint for Brown Dog to be used. -* `username`: (optional) username to be used with the endpoint for Brown Dog. -* `password`: (optional) password to be used with the endpoint for Brown Dog. - -This information is currently used by the following R functions: - -- `PEcAn.data.atmosphere::met.process` -- Generic function for processing meteorological input data. -- `PEcAn.benchmark::load_data` -- Generic, versatile function for loading data in various formats. - ### (experimental) Benchmarking {#xml-benchmarking} Coming soon... diff --git a/book_source/03_topical_pages/05_models/ed.Rmd b/book_source/03_topical_pages/05_models/ed.Rmd index eaa9c46ca21..a94df3b9d45 100644 --- a/book_source/03_topical_pages/05_models/ed.Rmd +++ b/book_source/03_topical_pages/05_models/ed.Rmd @@ -171,7 +171,7 @@ ED2 is configured using 2 files which are placed in the run folder. * **ED2IN** : template for this file is located at models/ed/inst/ED2IN.\. The values in this template that need to be modified are described below and are surrounded with @ symbols. * **config.xml** : this file is generated by PEcAn. Some values are stored in the pecan.xml in \\\ section as well as in \ section. -An example of the template can be found in [ED2IN.r82](https://github.com/PecanProject/pecan/blob/master/models/ed/inst/ED2IN.r82) +An example of the template can be found in [ED2IN.r82](https://github.com/PecanProject/pecan/blob/main/models/ed/inst/ED2IN.r82) The ED2IN template can contain the following variables. These will be replaced with actual values when the model configuration is written. diff --git a/book_source/03_topical_pages/09_standalone_tools.Rmd b/book_source/03_topical_pages/09_standalone_tools.Rmd index f9ca555a796..9462799e87b 100644 --- a/book_source/03_topical_pages/09_standalone_tools.Rmd +++ b/book_source/03_topical_pages/09_standalone_tools.Rmd @@ -43,7 +43,7 @@ To load the Ameriflux data for the Harvard Forest (US-Ha1) site. bety = PEcAn.DB::betyConnect(php.config = "pecan/web/config.php") ``` - where the complete path to the `config.php` is specified. See [here](https://github.com/PecanProject/pecan/blob/master/web/config.example.php) for an example `config.php` file. + where the complete path to the `config.php` is specified. See [here](https://github.com/PecanProject/pecan/blob/main/web/config.example.php) for an example `config.php` file. 2. Look up the inputs record for the data in BETY. diff --git a/book_source/03_topical_pages/11_adding_to_pecan.Rmd b/book_source/03_topical_pages/11_adding_to_pecan.Rmd index 620c5f5e298..224e893d279 100644 --- a/book_source/03_topical_pages/11_adding_to_pecan.Rmd +++ b/book_source/03_topical_pages/11_adding_to_pecan.Rmd @@ -149,7 +149,7 @@ The new variable can be used to create a prior distribution for it as in the "Cr #### Setting up the module directory (required) -PEcAn assumes that the interface modules are available as an R package in the models directory named after the model in question. The simplest way to get started on that R package is to make a copy the [_template_](https://github.com/PecanProject/pecan/tree/master/models/template) directory in the pecan/models folder and re-name it to the name of your model. In the code, filenames, and examples below you will want to substitute the word **MODEL** for the name of your model (note: R is case-sensitive). +PEcAn assumes that the interface modules are available as an R package in the models directory named after the model in question. The simplest way to get started on that R package is to make a copy the [_template_](https://github.com/PecanProject/pecan/tree/main/models/template) directory in the pecan/models folder and re-name it to the name of your model. In the code, filenames, and examples below you will want to substitute the word **MODEL** for the name of your model (note: R is case-sensitive). If you do not want to write the interface modules in R then it is fairly simple to set up the R functions describe below to just call the script you want to run using R's _system_ command. Scripts that are not R functions should be placed in the _inst_ folder and R can look up the location of these files using the function _system.file_ which takes as arguments the _local_ path of the file within the package folder and the name of the package (typically PEcAn.MODEL). For example @@ -697,9 +697,7 @@ This information is stored in a Format record in the bety database. Make sure to If the Format you are looking for is not available, you will need to create a new record. Before entering information into the database, you need to be able to answer the following questions about your data: - What is the file MIME type? - - We have a suit of functions for loading in data in open formats such as CSV, txt, netCDF, etc. - - PEcAn has partnered with the [NCSA BrownDog project](http://browndog.ncsa.illinois.edu/) to create a service that can read and convert as many data formats as possible. If your file type is less common or a proprietary type, you can use the [BrownDog DAP](http://dap.ncsa.illinois.edu/) to convert it to a format that can be used with PEcAn. - - If BrownDog cannot convert your data, you will need to contact us about writing a data specific load function. + - We have a suit of functions for loading in data in open formats such as CSV, txt, netCDF, etc. - What variables does the file contain? - What are the variables named? diff --git a/book_source/03_topical_pages/12_troubleshooting-pecan.Rmd b/book_source/03_topical_pages/12_troubleshooting-pecan.Rmd index 5d75b628b43..131eb071ec6 100755 --- a/book_source/03_topical_pages/12_troubleshooting-pecan.Rmd +++ b/book_source/03_topical_pages/12_troubleshooting-pecan.Rmd @@ -36,7 +36,7 @@ The next step is to add `debugonce()` before running the t This allows you can step through the function and evaluate the different objects as they are created and/or transformed. -See [tests README](https://github.com/PecanProject/pecan/blob/master/tests/README.md) for more information. +See [tests README](https://github.com/PecanProject/pecan/blob/main/tests/README.md) for more information. @@ -44,7 +44,7 @@ See [tests README](https://github.com/PecanProject/pecan/blob/master/tests/READM The following scripts (in `qaqc/vignettes` identify, respectively: -1. [relationships among functions across packages](https://github.com/PecanProject/pecan/blob/master/qaqc/vignettes/function_relationships.Rmd) -2. [function inputs and outputs](https://github.com/PecanProject/pecan/blob/master/qaqc/vignettes/module_output.Rmd) (e.g. that will identify which functions and outputs are used in a workflow). +1. [relationships among functions across packages](https://github.com/PecanProject/pecan/blob/main/qaqc/vignettes/function_relationships.Rmd) +2. [function inputs and outputs](https://github.com/PecanProject/pecan/blob/main/qaqc/vignettes/module_output.Rmd) (e.g. that will identify which functions and outputs are used in a workflow). diff --git a/book_source/03_topical_pages/92_workflow_modules.Rmd b/book_source/03_topical_pages/92_workflow_modules.Rmd index 2248287649b..4c6481a7f24 100644 --- a/book_source/03_topical_pages/92_workflow_modules.Rmd +++ b/book_source/03_topical_pages/92_workflow_modules.Rmd @@ -5,7 +5,7 @@ NOTE: As of PEcAn 1.2.6 -- needs to be updated significantly ## Overview -Workflow inputs and outputs (click to open in new page, then zoom). Code used to generate this image is provided in [qaqc/vignettes/module_output.Rmd](https://github.com/PecanProject/pecan/blob/master/qaqc/vignettes/module_output.Rmd) +Workflow inputs and outputs (click to open in new page, then zoom). Code used to generate this image is provided in [base/qaqc/vignettes/module_output.Rmd](https://github.com/PecanProject/pecan/blob/master/base/qaqc/vignettes/module_output.Rmd) [![PEcAn Workflow](http://isda.ncsa.illinois.edu/~kooper/EBI/workflow.svg)](http://isda.ncsa.illinois.edu/~kooper/EBI/workflow.svg) diff --git a/book_source/03_topical_pages/93_installation/03_install_OS/05_install_BETY.Rmd b/book_source/03_topical_pages/93_installation/03_install_OS/05_install_BETY.Rmd index 24739ba9154..a76c0ac3ad6 100644 --- a/book_source/03_topical_pages/93_installation/03_install_OS/05_install_BETY.Rmd +++ b/book_source/03_topical_pages/93_installation/03_install_OS/05_install_BETY.Rmd @@ -8,7 +8,7 @@ If you would like to install the Docker Version of BETY, please consult the [PEc #### Install Database + Data -* _note_ To install BETYdb without PEcAn, first download the [`load.bety.sh` script](https://raw.githubusercontent.com/PecanProject/pecan/master/scripts/load.bety.sh) +* _note_ To install BETYdb without PEcAn, first download the [`load.bety.sh` script](https://raw.githubusercontent.com/PecanProject/pecan/main/scripts/load.bety.sh) ```sh # install database (code assumes password is bety) diff --git a/book_source/03_topical_pages/94_docker/02_quickstart.Rmd b/book_source/03_topical_pages/94_docker/02_quickstart.Rmd index 94612ee13d4..d3014529b5f 100644 --- a/book_source/03_topical_pages/94_docker/02_quickstart.Rmd +++ b/book_source/03_topical_pages/94_docker/02_quickstart.Rmd @@ -35,11 +35,11 @@ curl -v -X POST \ ### Configure docker-compose {#pecan-setup-compose-configure} -This section will let you download some configuration files. The documentation provides links to the latest released version (master branch in GitHub) or the develop version that we are working on (develop branch in GitHub) which will become the next release. If you cloned the PEcAn GitHub repository you can use `git checkout ` to switch branches. +This section will let you download some configuration files. The documentation provides links to the latest released version (main branch in GitHub) or the develop version that we are working on (develop branch in GitHub) which will become the next release. If you cloned the PEcAn GitHub repository you can use `git checkout ` to switch branches. -The PEcAn Docker stack is configured using a `docker-compose.yml` file. You can download just this file directly from GitHub [latest](https://raw.githubusercontent.com/PecanProject/pecan/master/docker-compose.yml) or [develop](https://raw.githubusercontent.com/PecanProject/pecan/master/docker-compose.yml). You can also find this file in the root of cloned PEcAn GitHub repository. There is no need to edit the `docker-compose.yml` file. You can use either the `.env` file to change some of the settings, or the `docker-compose.override.yml` file to modify the `docker-compose.yml` file. This makes it easier for you to get an updated version of the `docker-compose.yml` file and not lose any changes you have made to it. +The PEcAn Docker stack is configured using a `docker-compose.yml` file. You can download just this file directly from GitHub [latest](https://raw.githubusercontent.com/PecanProject/pecan/main/docker-compose.yml) or [develop](https://raw.githubusercontent.com/PecanProject/pecan/main/docker-compose.yml). You can also find this file in the root of cloned PEcAn GitHub repository. There is no need to edit the `docker-compose.yml` file. You can use either the `.env` file to change some of the settings, or the `docker-compose.override.yml` file to modify the `docker-compose.yml` file. This makes it easier for you to get an updated version of the `docker-compose.yml` file and not lose any changes you have made to it. -Some of the settings in the `docker-compose.yml` can be set using a `.env` file. You can download either the [latest](https://raw.githubusercontent.com/PecanProject/pecan/master/docker/env.example) or the [develop](https://raw.githubusercontent.com/PecanProject/pecan/develop/docker/env.example) version. If you have cloned the GitHub repository it is also located in the docker folder. This file should be called `.env` and be placed in the same folder as your `docker-compose.yml` file. This file will allow you to set which version of PEcAn or BETY to use. See the comments in this file to control the settings. Option you might want to set are: +Some of the settings in the `docker-compose.yml` can be set using a `.env` file. You can download either the [latest](https://raw.githubusercontent.com/PecanProject/pecan/main/docker/env.example) or the [develop](https://raw.githubusercontent.com/PecanProject/pecan/develop/docker/env.example) version. If you have cloned the GitHub repository it is also located in the docker folder. This file should be called `.env` and be placed in the same folder as your `docker-compose.yml` file. This file will allow you to set which version of PEcAn or BETY to use. See the comments in this file to control the settings. Option you might want to set are: - `PECAN_VERSION` : The docker images to use for PEcAn. The default is `latest` which is the latest released version of PEcAn. Setting this to `develop` will result in using the version of PEcAn which will become the next release. - `PECAN_FQDN` : Is the name of the server where PEcAn is running. This is what is used to register all files generated by this version of PEcAn (see also `TRAEFIK_HOST`). @@ -48,7 +48,7 @@ Some of the settings in the `docker-compose.yml` can be set using a `.env` file. - `TRAEFIK_HOST` : Should be the FQDN of the server, this is needed when generating a SSL certificate. For SSL certificates you will need to set `TRAEFIK_ACME_ENABLE` as well as `TRAEFIK_ACME_EMAIL`. - `TRAEFIK_IPFILTER` : is used to limit access to certain resources, such as RabbitMQ and the Traefik dashboard. -A final file, which is optional, is a `docker-compose.override.yml`. You can download a version for the [latest](https://raw.githubusercontent.com/PecanProject/pecan/master/docker/docker-compose.example.yml) and [develop](https://raw.githubusercontent.com/PecanProject/pecan/develop/docker/docker-compose.example.yml) versions. If you have cloned the GitHub repository it is located in the docker folder. Use this file as an example of what you can do, only copy the pieces over that you really need. This will allow you to make changes to the docker-compose file for your local installation. You can use this to add additional containers to your stack, change the path where docker stores the data for the containers, or you can use this to open up the postgresql port. +A final file, which is optional, is a `docker-compose.override.yml`. You can download a version for the [latest](https://raw.githubusercontent.com/PecanProject/pecan/main/docker/docker-compose.example.yml) and [develop](https://raw.githubusercontent.com/PecanProject/pecan/develop/docker/docker-compose.example.yml) versions. If you have cloned the GitHub repository it is located in the docker folder. Use this file as an example of what you can do, only copy the pieces over that you really need. This will allow you to make changes to the docker-compose file for your local installation. You can use this to add additional containers to your stack, change the path where docker stores the data for the containers, or you can use this to open up the postgresql port. ```yaml version: "3" diff --git a/book_source/04_appendix/03_courses_taught.Rmd b/book_source/04_appendix/03_courses_taught.Rmd index 17d1bb83bac..b03adbd0899 100755 --- a/book_source/04_appendix/03_courses_taught.Rmd +++ b/book_source/04_appendix/03_courses_taught.Rmd @@ -38,5 +38,5 @@ Session 4: Integrating Forest Data Into Ecosystem Models ## Selected Publications -1. Dietze, M.C., D.S LeBauer, R. Kooper (2013) [On improving the communication between models and data](https://github.com/PecanProject/pecan/blob/master/documentation/dietze2013oic.pdf?raw=true). Plant, Cell, & Environment doi:10.1111/pce.12043 -2. LeBauer, D.S., D. Wang, K. Richter, C. Davidson, & M.C. Dietze. (2013). [Facilitating feedbacks between field measurements and ecosystem models](https://github.com/PecanProject/pecan/blob/master/documentation/lebauer2013ffb.pdf?raw=true). Ecological Monographs. doi:10.1890/12-0137.1 \ No newline at end of file +1. Dietze, M.C., D.S LeBauer, R. Kooper (2013) [On improving the communication between models and data](https://github.com/PecanProject/pecan/blob/main/documentation/dietze2013oic.pdf?raw=true). Plant, Cell, & Environment doi:10.1111/pce.12043 +2. LeBauer, D.S., D. Wang, K. Richter, C. Davidson, & M.C. Dietze. (2013). [Facilitating feedbacks between field measurements and ecosystem models](https://github.com/PecanProject/pecan/blob/main/documentation/lebauer2013ffb.pdf?raw=true). Ecological Monographs. doi:10.1890/12-0137.1 \ No newline at end of file diff --git a/contrib/browndog/README.md b/contrib/browndog/README.md index d341eb2ffdf..200be8bbc63 100644 --- a/contrib/browndog/README.md +++ b/contrib/browndog/README.md @@ -11,7 +11,6 @@ and for the DTS: ------------------------------------------------------------------------------------------------------ -To excute browndog.R, you need to change the parameters such as type, browndog, userpass. To excute PEcAn.R, you need to install PEcAn.data.atmosphere. Please refer to https://pecanproject.github.io/pecan//modules/data.atmosphere/inst/web/index.html (Use install.packages("devtools") if you don't have this library. diff --git a/contrib/browndog/browndog.R b/contrib/browndog/browndog.R deleted file mode 100755 index 916cbb71c7a..00000000000 --- a/contrib/browndog/browndog.R +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/Rscript - -library(RCurl) - -##' Try and download a file. -##' -##' This will download a file. If a 404 is returned it will wait until -##' the file is available; if the file is still not available after -##' timeout tries, it will return NA. If the file is downloaded it will -##' return the name of the file -##' -##' @name download.browndog -##' @title Download file from browndog. -##' @param the url of the file to download -##' @param the filename -##' @param timeout number of seconds to wait for file (default 60) -##' @param list of options for curl, for example to download from a protected site use list(userpwd=userpass, httpauth = 1L) -##' @return returns name of file if successfull or NA if not. -##' @examples -##' \dontrun{ -##' download.browndog('http://localhost/', index.html) -##' } -download.browndog <- function(url, file, timeout = 60, .opts = list()) { - count <- 0 - while (!url.exists(url, .opts = .opts) && count < timeout) { - count <- count + 1 - Sys.sleep(1) - } - if (count >= timeout) { - return(NA) - } - f <- CFILE(file, mode = "wb") - curlPerform(url = url, writedata = f@ref, .opts = .opts) - RCurl::close(f) - - return(file) -} # download.browndog - -type <- "NARR" -site <- "US-NR1" -site_lat <- "40.0329" -site_lon <- "-105.546" -startDate <- "2001-01-01 00:00:00" -endDate <- "2001-12-31 23:59:59" -browndog <- "http://host/path" -userpass <- "user:password" -output <- "clim" - -outputfile <- paste(site, output, sep = ".") - -xmldata <- paste0("", - "", type, "", - "", site, "", - "", site_lat, "", - "", site_lon, "", - "", startDate, "", - "", endDate, "", - "") - -# post to browndog -curloptions <- list(userpwd = userpass, httpauth = 1L, followlocation = TRUE) -result <- postForm(paste0(browndog, output, "/"), fileData = fileUpload("pecan.xml", xmldata, "text/xml"), - .opts = curloptions) -url <- gsub(".*(.*).*", "\\1", result) -download.browndog(url, outputfile, 120, curloptions) diff --git a/docker-compose.yml b/docker-compose.yml index 92af1a03a95..da03250edc3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -52,6 +52,11 @@ services: - "traefik.http.routers.rabbitmq.rule=Host(`rabbitmq.pecan.localhost`)" volumes: - rabbitmq:/var/lib/rabbitmq + healthcheck: + test: rabbitmqctl ping + interval: 10s + timeout: 5s + retries: 5 # ---------------------------------------------------------------------- # Database to hold the data from PEcAn and BETY. @@ -65,6 +70,11 @@ services: - pecan volumes: - postgres:/var/lib/postgresql/data + healthcheck: + test: pg_isready -U postgres + interval: 10s + timeout: 5s + retries: 5 # ---------------------------------------------------------------------- # BETY rails frontend to the database @@ -82,11 +92,17 @@ services: volumes: - bety:/home/bety/log depends_on: - - postgres + postgres: + condition: service_healthy labels: - "traefik.enable=true" - "traefik.http.services.bety.loadbalancer.server.port=8000" - "traefik.http.routers.bety.rule=Host(`${TRAEFIK_HOST:-pecan.localhost}`) && PathPrefix(`/bety/`)" + healthcheck: + test: "curl --silent --fail http://localhost:8000/$${RAILS_RELATIVE_URL_ROOT} > /dev/null || exit 1" + interval: 10s + timeout: 5s + retries: 5 # ---------------------------------------------------------------------- # RStudio @@ -98,8 +114,10 @@ services: networks: - pecan depends_on: - - rabbitmq - - postgres + postgres: + condition: service_healthy + rabbitmq: + condition: service_healthy environment: - KEEP_ENV=RABBITMQ_URI RABBITMQ_PREFIX RABBITMQ_PORT FQDN NAME - RABBITMQ_URI=${RABBITMQ_URI:-amqp://guest:guest@rabbitmq/%2F} @@ -141,6 +159,11 @@ services: - "traefik.enable=true" - "traefik.http.services.docs.loadbalancer.server.port=80" - "traefik.http.routers.docs.rule=Host(`${TRAEFIK_HOST:-pecan.localhost}`) && PathPrefix(`/`)" + healthcheck: + test: "curl --silent --fail http://localhost/ > /dev/null || exit 1" + interval: 10s + timeout: 5s + retries: 5 # PEcAn web front end, this is just the PHP code pecan: @@ -155,8 +178,10 @@ services: - NAME=${PECAN_NAME:-docker} - SECRET_KEY_BASE=${BETY_SECRET_KEY:-thisisnotasecret} depends_on: - - postgres - - rabbitmq + postgres: + condition: service_healthy + rabbitmq: + condition: service_healthy labels: - "traefik.enable=true" - "traefik.http.services.pecan.loadbalancer.server.port=8080" @@ -164,6 +189,11 @@ services: volumes: - pecan:/data - pecan:/var/www/html/pecan/data + healthcheck: + test: "curl --silent --fail http://localhost:8080/pecan > /dev/null || exit 1" + interval: 10s + timeout: 5s + retries: 5 # PEcAn model monitor monitor: @@ -176,7 +206,10 @@ services: - RABBITMQ_URI=${RABBITMQ_URI:-amqp://guest:guest@rabbitmq/%2F} - FQDN=${PECAN_FQDN:-docker} depends_on: - - rabbitmq + postgres: + condition: service_healthy + rabbitmq: + condition: service_healthy labels: - "traefik.enable=true" - "traefik.http.routers.monitor.rule=Host(`${TRAEFIK_HOST:-pecan.localhost}`) && PathPrefix(`/monitor/`)" @@ -184,6 +217,11 @@ services: - "traefik.http.middlewares.monitor-stripprefix.stripprefix.prefixes=/monitor" volumes: - pecan:/data + healthcheck: + test: "curl --silent --fail http://localhost:9999 > /dev/null || exit 1" + interval: 10s + timeout: 5s + retries: 5 # PEcAn executor, executes jobs. Does not the actual models executor: @@ -198,8 +236,10 @@ services: - RABBITMQ_PORT=15672 - FQDN=${PECAN_FQDN:-docker} depends_on: - - postgres - - rabbitmq + postgres: + condition: service_healthy + rabbitmq: + condition: service_healthy volumes: - pecan:/data @@ -216,7 +256,8 @@ services: environment: - RABBITMQ_URI=${RABBITMQ_URI:-amqp://guest:guest@rabbitmq/%2F} depends_on: - - rabbitmq + rabbitmq: + condition: service_healthy volumes: - pecan:/data @@ -230,7 +271,8 @@ services: environment: - RABBITMQ_URI=${RABBITMQ_URI:-amqp://guest:guest@rabbitmq/%2F} depends_on: - - rabbitmq + rabbitmq: + condition: service_healthy volumes: - pecan:/data @@ -244,7 +286,8 @@ services: environment: - RABBITMQ_URI=${RABBITMQ_URI:-amqp://guest:guest@rabbitmq/%2F} depends_on: - - rabbitmq + rabbitmq: + condition: service_healthy volumes: - pecan:/data @@ -258,7 +301,8 @@ services: environment: - RABBITMQ_URI=${RABBITMQ_URI:-amqp://guest:guest@rabbitmq/%2F} depends_on: - - rabbitmq + rabbitmq: + condition: service_healthy volumes: - pecan:/data @@ -272,7 +316,8 @@ services: environment: - RABBITMQ_URI=${RABBITMQ_URI:-amqp://guest:guest@rabbitmq/%2F} depends_on: - - rabbitmq + rabbitmq: + condition: service_healthy volumes: - pecan:/data @@ -286,7 +331,8 @@ services: environment: - RABBITMQ_URI=${RABBITMQ_URI:-amqp://guest:guest@rabbitmq/%2F} depends_on: - - rabbitmq + rabbitmq: + condition: service_healthy volumes: - pecan:/data @@ -300,12 +346,18 @@ services: networks: - pecan depends_on: - - postgres + postgres: + condition: service_healthy labels: - "traefik.enable=true" - "traefik.http.routers.dbsync.rule=Host(`${TRAEFIK_HOST:-pecan.localhost}`) && PathPrefix(`/dbsync/`)" - "traefik.http.routers.dbsync.middlewares=dbsync-stripprefix" - "traefik.http.middlewares.dbsync-stripprefix.stripprefix.prefixes=/monitor" + healthcheck: + test: "curl --silent --fail http://localhost:3838 > /dev/null || exit 1" + interval: 10s + timeout: 5s + retries: 5 # ---------------------------------------------------------------------- # PEcAn API @@ -329,9 +381,15 @@ services: - "traefik.http.routers.api.rule=Host(`${TRAEFIK_HOST:-pecan.localhost}`) && PathPrefix(`/api/`)" - "traefik.http.services.api.loadbalancer.server.port=8000" depends_on: - - postgres + postgres: + condition: service_healthy volumes: - pecan:/data/ + healthcheck: + test: "curl --silent --fail http://localhost:8000/api/ping > /dev/null || exit 1" + interval: 10s + timeout: 5s + retries: 5 # ---------------------------------------------------------------------- # Name of network to be used by all containers diff --git a/docker.sh b/docker.sh index c37f672220b..4a2e3353992 100755 --- a/docker.sh +++ b/docker.sh @@ -26,7 +26,7 @@ PECAN_GIT_DATE="$(git log --pretty=format:%ad -1)" VERSION=${VERSION:-"$(awk '/Version:/ { print $2 }' base/all/DESCRIPTION)"} # check for branch and set IMAGE_VERSION -if [ "${PECAN_GIT_BRANCH}" == "master" ]; then +if [ "${PECAN_GIT_BRANCH}" == "main" ]; then IMAGE_VERSION=${IMAGE_VERSION:-"latest"} elif [ "${PECAN_GIT_BRANCH}" == "develop" ]; then IMAGE_VERSION=${IMAGE_VERSION:-"develop"} @@ -49,7 +49,7 @@ $0 [-dfhn] [-i ] [-r # ---------------------------------------------------------------------- # PEcAn version information @@ -26,9 +25,7 @@ COPY models /pecan/models/ # install all PEcAn packages # `make clean` is to remove artifacts copied in from host system # (e.g. basgra.so) -RUN --mount=type=secret,id=github_token \ - export GITHUB_PAT=`cat /run/secrets/github_token` \ - && cd /pecan \ +RUN cd /pecan \ && make clean \ && make \ && rm -rf /tmp/downloaded_packages @@ -38,7 +35,7 @@ WORKDIR /work COPY web/workflow.R docker/base/rstudio.sh /work/ # COMMAND TO RUN -CMD Rscript --vanilla workflow.R | tee workflow.Rout +CMD ["bash", "-c", "Rscript --vanilla workflow.R | tee workflow.Rout"] # variables to store in docker image ENV PECAN_VERSION=${PECAN_VERSION} \ diff --git a/docker/data/Dockerfile b/docker/data/Dockerfile index 2ac60cd7e83..1302d201acf 100644 --- a/docker/data/Dockerfile +++ b/docker/data/Dockerfile @@ -1,5 +1,4 @@ FROM alpine -MAINTAINER Rob Kooper # name to use in the machines table FQDN when registering the data files ENV FQDN="" \ @@ -19,4 +18,4 @@ RUN apk --no-cache add bash curl rsync postgresql-client unzip \ && curl -s -o create_met_driver.tar.gz http://isda.ncsa.illinois.edu/~kooper/EBI/create_met_driver.tar.gz COPY add-data.sh add.util.sh /work/ -CMD bash /work/add-data.sh +CMD ["bash", "/work/add-data.sh"] diff --git a/docker/depends/Dockerfile b/docker/depends/Dockerfile index 8afa79b5ad7..b784bcd3bfa 100644 --- a/docker/depends/Dockerfile +++ b/docker/depends/Dockerfile @@ -5,8 +5,6 @@ ARG FROM_IMAGE="rocker/tidyverse" # PECAN FOR MODEL BASE IMAGE # ---------------------------------------------------------------------- FROM ${FROM_IMAGE}:${R_VERSION} -MAINTAINER Rob Kooper - # ---------------------------------------------------------------------- # INSTALL BINARY/LIBRARY DEPENDENCIES @@ -33,9 +31,7 @@ RUN apt-get update \ # INSTALL DEPENDENCIES # ---------------------------------------------------------------------- COPY pecan.depends.R pecan_package_dependencies.csv pecan_deps_from_github.txt / -RUN --mount=type=secret,id=github_token \ - export GITHUB_PAT=`cat /run/secrets/github_token` \ - && Rscript -e "install.packages(c('desc', 'remotes'))" \ +RUN Rscript -e "install.packages(c('desc', 'remotes'))" \ && R_LIBS_USER='/usr/local/lib/R/site-library' Rscript /pecan.depends.R \ && rm -rf /tmp/* diff --git a/docker/depends/pecan_package_dependencies.csv b/docker/depends/pecan_package_dependencies.csv index fe66050ff8c..42e3077f261 100644 --- a/docker/depends/pecan_package_dependencies.csv +++ b/docker/depends/pecan_package_dependencies.csv @@ -11,7 +11,6 @@ "BayesianTools","*","modules/rtm","Imports",FALSE "BioCro","*","models/biocro","Suggests",FALSE "bit64","*","base/db","Suggests",FALSE -"BrownDog","*","modules/benchmark","Suggests",FALSE "coda","*","models/maespa","Suggests",FALSE "coda","*","models/sipnet","Suggests",FALSE "coda","*","modules/assim.sequential","Imports",FALSE @@ -24,7 +23,6 @@ "coda",">= 0.18","modules/meta.analysis","Imports",FALSE "coda",">= 0.18","modules/photosynthesis","Imports",FALSE "corrplot","*","modules/assim.sequential","Suggests",FALSE -"curl","*","base/db","Imports",FALSE "curl","*","base/utils","Imports",FALSE "curl","*","modules/data.atmosphere","Imports",FALSE "curl","*","modules/data.land","Imports",FALSE @@ -35,7 +33,7 @@ "data.table","*","models/biocro","Imports",FALSE "data.table","*","modules/data.remote","Suggests",FALSE "dataone","*","modules/data.land","Suggests",FALSE -"datapack","*","modules/data.land","Imports",FALSE +"datapack","*","modules/data.land","Suggests",FALSE "DBI","*","base/db","Imports",FALSE "DBI","*","modules/data.remote","Imports",FALSE "dbplyr",">= 2.4.0","base/db","Imports",FALSE @@ -56,6 +54,7 @@ "dplyr","*","modules/benchmark","Imports",FALSE "dplyr","*","modules/data.land","Imports",FALSE "dplyr","*","modules/data.remote","Suggests",FALSE +"dplyr","*","modules/priors","Suggests",FALSE "dplyr","*","modules/uncertainty","Imports",FALSE "dplyr",">= 0.8.1","modules/data.atmosphere","Imports",FALSE "dplyr",">= 1.1.2","base/db","Imports",FALSE @@ -125,6 +124,7 @@ "keras3",">= 1.0.0","modules/assim.sequential","Suggests",FALSE "knitr","*","base/visualization","Suggests",FALSE "knitr","*","modules/data.atmosphere","Suggests",FALSE +"knitr","*","modules/priors","Suggests",FALSE "knitr",">= 1.42","base/db","Suggests",FALSE "knitr",">= 1.42","base/qaqc","Suggests",FALSE "knitr",">= 1.42","modules/allometry","Suggests",FALSE @@ -409,6 +409,7 @@ "PEcAn.utils","*","modules/data.land","Imports",TRUE "PEcAn.utils","*","modules/data.remote","Imports",TRUE "PEcAn.utils","*","modules/meta.analysis","Imports",TRUE +"PEcAn.utils","*","modules/priors","Imports",TRUE "PEcAn.utils","*","modules/rtm","Suggests",TRUE "PEcAn.utils","*","modules/uncertainty","Imports",TRUE "PEcAn.utils",">= 1.4.8","models/basgra","Imports",TRUE @@ -470,6 +471,7 @@ "rjags","*","modules/data.land","Imports",FALSE "rjags","*","modules/meta.analysis","Imports",FALSE "rjags","*","modules/photosynthesis","Depends",FALSE +"rjags","*","modules/priors","Suggests",FALSE "rjson","*","models/dvmdostem","Imports",FALSE "rlang","*","base/db","Imports",FALSE "rlang","*","base/qaqc","Imports",FALSE @@ -486,6 +488,8 @@ "rlang",">= 0.2.0","modules/data.atmosphere","Imports",FALSE "rlist","*","modules/assim.sequential","Suggests",FALSE "rmarkdown","*","base/visualization","Suggests",FALSE +"rmarkdown","*","modules/priors","Suggests",FALSE +"rmarkdown","*","modules/rtm","Suggests",FALSE "rmarkdown",">= 2.19","base/db","Suggests",FALSE "rmarkdown",">= 2.19","base/qaqc","Suggests",FALSE "rmarkdown",">= 2.19","modules/allometry","Suggests",FALSE @@ -661,7 +665,6 @@ "withr","*","models/sibcasa","Suggests",FALSE "withr","*","modules/allometry","Suggests",FALSE "withr","*","modules/data.atmosphere","Suggests",FALSE -"XML","*","base/db","Imports",FALSE "XML","*","base/workflow","Imports",FALSE "XML","*","models/biocro","Imports",FALSE "XML","*","models/maat","Imports",FALSE diff --git a/docker/docs/Dockerfile b/docker/docs/Dockerfile index 2c98d076a03..315769eed57 100644 --- a/docker/docs/Dockerfile +++ b/docker/docs/Dockerfile @@ -5,7 +5,6 @@ ARG IMAGE_VERSION="latest" # compile bookdown to html # ---------------------------------------------------------------------- FROM pecan/base:${IMAGE_VERSION} AS pecandocs -MAINTAINER Rob Kooper RUN apt-get update \ && apt-get install -y --no-install-recommends pandoc \ @@ -28,7 +27,11 @@ RUN make build # copy html pages to container # ---------------------------------------------------------------------- FROM httpd -MAINTAINER Rob Kooper + +# need curl for health checks +RUN apt-get update \ + && apt-get install -y curl \ + && rm -rf /var/lib/apt/lists/* COPY docker/docs/index.html /usr/local/apache2/htdocs/ COPY --from=pecandocs /src/book_source/_book/ /usr/local/apache2/htdocs/docs/pecan/ diff --git a/docker/executor/Dockerfile b/docker/executor/Dockerfile index 34722783909..19cecced3cd 100644 --- a/docker/executor/Dockerfile +++ b/docker/executor/Dockerfile @@ -5,7 +5,6 @@ ARG IMAGE_VERSION="latest" # PECAN FOR MODEL BASE IMAGE # ---------------------------------------------------------------------- FROM pecan/base:${IMAGE_VERSION} -MAINTAINER Rob Kooper # ---------------------------------------------------------------------- # SETUP FOR PYTHON CODE @@ -24,4 +23,4 @@ ENV RABBITMQ_URI="amqp://guest:guest@rabbitmq/%2F" \ # actual application that will be executed COPY executor.py /work/ -CMD python3 /work/executor.py +CMD ["python3", "/work/executor.py"] diff --git a/docker/models/Dockerfile b/docker/models/Dockerfile index 1870fba9a03..f76f51382e1 100644 --- a/docker/models/Dockerfile +++ b/docker/models/Dockerfile @@ -5,7 +5,6 @@ ARG IMAGE_VERSION="latest" # PECAN FOR MODEL BASE IMAGE # ---------------------------------------------------------------------- FROM pecan/base:${IMAGE_VERSION} -MAINTAINER Rob Kooper # ---------------------------------------------------------------------- # SETUP FOR PYTHON CODE @@ -23,4 +22,4 @@ ENV RABBITMQ_URI="amqp://guest:guest@rabbitmq/%2F" \ # actual application that will be executed COPY model.py /work/ -CMD python3 /work/model.py +CMD ["python3", "/work/model.py"] diff --git a/docker/monitor/Dockerfile b/docker/monitor/Dockerfile index 24232352fca..ec479cc2458 100644 --- a/docker/monitor/Dockerfile +++ b/docker/monitor/Dockerfile @@ -17,4 +17,4 @@ COPY requirements.txt /src/ RUN pip3 install -r /src/requirements.txt COPY . /src/ -CMD python3 monitor.py +CMD ["python3", "./monitor.py"] diff --git a/docker/rstudio-nginx/Dockerfile b/docker/rstudio-nginx/Dockerfile index 600c1da6484..af33c2c3d71 100644 --- a/docker/rstudio-nginx/Dockerfile +++ b/docker/rstudio-nginx/Dockerfile @@ -1,4 +1,3 @@ FROM nginx:alpine -MAINTAINER Rob Kooper COPY nginx.conf /etc/nginx/conf.d/default.conf diff --git a/docker/web/Dockerfile b/docker/web/Dockerfile index f22315cf3d5..9382561e6e7 100644 --- a/docker/web/Dockerfile +++ b/docker/web/Dockerfile @@ -1,5 +1,4 @@ FROM php:8-apache -MAINTAINER Rob Kooper # ---------------------------------------------------------------------- # install rabbitmq and postgresql extentions diff --git a/docker/web/config.docker.php b/docker/web/config.docker.php index 4c601438c97..a54fb0e7fff 100644 --- a/docker/web/config.docker.php +++ b/docker/web/config.docker.php @@ -16,10 +16,6 @@ $db_fia_password=""; $db_fia_database=""; -# browdog information -$browndog_url=""; -$browndog_username=""; -$browndog_password=""; # R binary $Rbinary="/usr/bin/R"; diff --git a/documentation/index_vm.html b/documentation/index_vm.html index d6d3166157a..562f92d88f6 100644 --- a/documentation/index_vm.html +++ b/documentation/index_vm.html @@ -30,7 +30,7 @@

Documentation

The documentation for PEcAn is rendered using bookdown. A PDF version can be found locally. The most up to date version can be found at - our website. diff --git a/documentation/tutorials/01_Demo_Basic_Run/Demo01.Rmd b/documentation/tutorials/01_Demo_Basic_Run/Demo01.Rmd index 97ec998211f..57fbc7db351 100644 --- a/documentation/tutorials/01_Demo_Basic_Run/Demo01.Rmd +++ b/documentation/tutorials/01_Demo_Basic_Run/Demo01.Rmd @@ -155,7 +155,7 @@ The entire PEcAn team welcomes any questions you may have! **If the Finished Stage has a Status of “DONE”, congratulations!** If you got this far, you have managed to run an ecosystem model without ever touching a line of code! Now it’s time to look at the results **click Finished**. -FYI, [adding a new model](https://pecanproject.github.io/pecan-documentation/master/adding-an-ecosystem-model.html) to PEcAn does not require modification of the model’s code, just the implementation of a wrapper function. +FYI, [adding a new model](https://pecanproject.github.io/pecan-documentation/latest/adding-an-ecosystem-model.html) to PEcAn does not require modification of the model’s code, just the implementation of a wrapper function. #### Output and Visualization diff --git a/documentation/tutorials/02_Demo_Uncertainty_Analysis/Demo02.Rmd b/documentation/tutorials/02_Demo_Uncertainty_Analysis/Demo02.Rmd index b560ff39258..f9164088852 100644 --- a/documentation/tutorials/02_Demo_Uncertainty_Analysis/Demo02.Rmd +++ b/documentation/tutorials/02_Demo_Uncertainty_Analysis/Demo02.Rmd @@ -97,12 +97,12 @@ The [next set of tutorials](#demo-table) will focus on the process of data assim #### Assimilation 'by hand' -[Explore](https://github.com/PecanProject/pecan/blob/master/documentation/tutorials/sensitivity/PEcAn_sensitivity_tutorial_v1.0.Rmd) how model error changes as a function of parameter value (i.e. data assimilation ‘by hand’) +[Explore](https://github.com/PecanProject/pecan/blob/main/documentation/tutorials/sensitivity/PEcAn_sensitivity_tutorial_v1.0.Rmd) how model error changes as a function of parameter value (i.e. data assimilation ‘by hand’) #### MCMC Concepts -[Explore](https://github.com/PecanProject/pecan/blob/master/documentation/tutorials/MCMC/MCMC_Concepts.Rmd) Bayesian MCMC concepts using the photosynthesis module +[Explore](https://github.com/PecanProject/pecan/blob/main/documentation/tutorials/MCMC/MCMC_Concepts.Rmd) Bayesian MCMC concepts using the photosynthesis module #### More info about tools, analyses, and specific tasks… diff --git a/documentation/tutorials/MCMC/MCMC_Concepts.Rmd b/documentation/tutorials/MCMC/MCMC_Concepts.Rmd index 162054f6ce0..46abe98f455 100644 --- a/documentation/tutorials/MCMC/MCMC_Concepts.Rmd +++ b/documentation/tutorials/MCMC/MCMC_Concepts.Rmd @@ -78,7 +78,7 @@ plot(dat$Ci[aci],dat$Photo[aci],main="ACi") plot(dat$PARi[!aci],dat$Photo[!aci],main="AQ") ``` -In PEcAn we've written a wrapper function, $fitA$, around the statistical model discussed above, which has a number of other bells and whistles discussed in the [PEcAn Photosynthesis Vignette](https://github.com/PecanProject/pecan/blob/master/modules/photosynthesis/vignettes/ResponseCurves.Rmd). For today we'll just use the most basic version, which takes as arguments the data and the number of MCMC iterations we want to run. +In PEcAn we've written a wrapper function, $fitA$, around the statistical model discussed above, which has a number of other bells and whistles discussed in the [PEcAn Photosynthesis Vignette](https://github.com/PecanProject/pecan/blob/main/modules/photosynthesis/vignettes/ResponseCurves.Rmd). For today we'll just use the most basic version, which takes as arguments the data and the number of MCMC iterations we want to run. ```{r echo=TRUE, eval=FALSE} fit <- fitA(dat,model=list(n.iter=10000)) @@ -179,7 +179,7 @@ Note: on the last figure you will get warnings about "No ACi" and "No AQ" which #### Additional information -There is a more detailed R Vignette on the use of the PEcAn photosynthesis module available in the [PEcAn Repository](https://github.com/PecanProject/pecan/blob/master/modules/photosynthesis/vignettes/ResponseCurves.Rmd). +There is a more detailed R Vignette on the use of the PEcAn photosynthesis module available in the [PEcAn Repository](https://github.com/PecanProject/pecan/blob/main/modules/photosynthesis/vignettes/ResponseCurves.Rmd). #### Citations diff --git a/documentation/tutorials/deploy.sh b/documentation/tutorials/deploy.sh index a4497227e55..434fadcaf5f 100755 --- a/documentation/tutorials/deploy.sh +++ b/documentation/tutorials/deploy.sh @@ -40,4 +40,4 @@ done < buildfiles cd book_hosted git add --all * git commit -m "Update tutorials `date`" || true -git push -q origin master +git push -q origin latest diff --git a/models/biocro/R/model2netcdf.BIOCRO.R b/models/biocro/R/model2netcdf.BIOCRO.R index 3d8269266cc..03c7cab4238 100644 --- a/models/biocro/R/model2netcdf.BIOCRO.R +++ b/models/biocro/R/model2netcdf.BIOCRO.R @@ -91,7 +91,7 @@ model2netcdf.BIOCRO <- function(result, genus = NULL, outdir, lat = -9999, lon = nc <- ncdf4::nc_open(ncfile, write = TRUE) } else { nc <- ncdf4::nc_create(filename = file.path(outdir, paste0(yeari, ".nc")), vars = vars) - ncdf4::ncatt_put(nc, 0, "description", "This is an output from the BioCro Crop model generated by the model2netcdf.BIOCRO.R function in the PEcAn.BIOCRO package; see https://pecanproject.github.io/pecan-documentation/master/ for more information") + ncdf4::ncatt_put(nc, 0, "description", "This is an output from the BioCro Crop model generated by the model2netcdf.BIOCRO.R function in the PEcAn.BIOCRO package; see https://pecanproject.github.io/pecan-documentation/latest/ for more information") } varfile <- file(file.path(outdir, paste(yeari, "nc", "var", sep = ".")), "w") diff --git a/models/clm45/LICENSE b/models/clm45/LICENSE index 9e38c2dc685..09ef35a60b4 100644 --- a/models/clm45/LICENSE +++ b/models/clm45/LICENSE @@ -1,29 +1,3 @@ -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. - +YEAR: 2024 +COPYRIGHT HOLDER: PEcAn Project +ORGANIZATION: PEcAn Project, authors affiliations diff --git a/models/clm45/NEWS.md b/models/clm45/NEWS.md new file mode 100644 index 00000000000..72171423795 --- /dev/null +++ b/models/clm45/NEWS.md @@ -0,0 +1,10 @@ +# PEcAn.CLM45 1.7.3.9000 + +## License change +* PEcAn.CLM45 is now distributed under the BSD three-clause license instead of the NCSA Open Source license. + + +# PEcAn.CLM45 1.7.1 + +* All changes in 1.7.1 and earlier were recorded in a single file for all of the PEcAn packages; please see +https://github.com/PecanProject/pecan/blob/v1.7.1/CHANGELOG.md for details. diff --git a/models/clm45/R/met2model.CLM45.R b/models/clm45/R/met2model.CLM45.R index 60dda63ca0f..f8759922a13 100644 --- a/models/clm45/R/met2model.CLM45.R +++ b/models/clm45/R/met2model.CLM45.R @@ -1,12 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2015 NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- -# ## R Code to convert NetCDF CF met files into NetCDF CLM met files. ##' met2model wrapper for CLM45 diff --git a/models/clm45/R/model2netcdf.CLM45.R b/models/clm45/R/model2netcdf.CLM45.R index 6f028bf4768..ec98d75e13a 100644 --- a/models/clm45/R/model2netcdf.CLM45.R +++ b/models/clm45/R/model2netcdf.CLM45.R @@ -1,11 +1,3 @@ -## ------------------------------------------------------------------------------- -## Copyright (c) 2015 NCSA. -## All rights reserved. This program and the accompanying materials -## are made available under the terms of the -## University of Illinois/NCSA Open Source License -## which accompanies this distribution, and is available at -## http://opensource.ncsa.illinois.edu/license.html -## --------------------------------------------------------------------- ##' ##' @name model2netcdf.CLM45 ##' @title Code to convert CLM45 netcdf output into into CF standard diff --git a/models/clm45/R/write.configs.CLM45.R b/models/clm45/R/write.configs.CLM45.R index 205e733537e..7c4c6a88b33 100644 --- a/models/clm45/R/write.configs.CLM45.R +++ b/models/clm45/R/write.configs.CLM45.R @@ -1,12 +1,3 @@ -##------------------------------------------------------------------------------ -##Copyright (c) 2015 NCSA -##All rights reserved. This program and the accompanying materials -##are made available under the terms of the -##University of Illinois/NCSA Open Source License -##which accompanies this distribution, and is available at -##http://opensource.ncsa.illinois.edu/license.html -##------------------------------------------------------------------------------ -##-------------------------------------------------------------------------------------------------# ##' Writes config files for use with the Community Land Model model. ##' ##' @name write.config.CLM45 diff --git a/models/clm45/tests/testthat.R b/models/clm45/tests/testthat.R index 2582bc74de6..bd9de84301b 100644 --- a/models/clm45/tests/testthat.R +++ b/models/clm45/tests/testthat.R @@ -1,11 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- library(testthat) library(PEcAn.utils) diff --git a/models/dalec/DESCRIPTION b/models/dalec/DESCRIPTION index 3dacc2cb3fc..a73bd635c4d 100644 --- a/models/dalec/DESCRIPTION +++ b/models/dalec/DESCRIPTION @@ -5,7 +5,8 @@ Version: 1.7.3.9000 Authors@R: c(person("Mike", "Dietze", role = c("aut", "cre"), email = "dietze@bu.edu"), person("Tristan", "Quaife", role = c("aut")), - person("University of Illinois, NCSA", role = c("cph"))) + person("University of Illinois, NCSA", role = c("cph")), + person("Boston University", role = c("cph"))) Author: Mike Dietze, Tristain Quaife Maintainer: Mike Dietze Description: This module provides functions to link DALEC to PEcAn. diff --git a/models/dalec/LICENSE b/models/dalec/LICENSE index 5a9e44128f1..09ef35a60b4 100644 --- a/models/dalec/LICENSE +++ b/models/dalec/LICENSE @@ -1,34 +1,3 @@ -## This is the master copy of the PEcAn License - -University of Illinois/NCSA Open Source License - -Copyright (c) 2012, University of Illinois, NCSA. All rights reserved. - -PEcAn project -www.pecanproject.org - -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. - +YEAR: 2024 +COPYRIGHT HOLDER: PEcAn Project +ORGANIZATION: PEcAn Project, authors affiliations diff --git a/models/dalec/NEWS.md b/models/dalec/NEWS.md new file mode 100644 index 00000000000..cd70e8ae222 --- /dev/null +++ b/models/dalec/NEWS.md @@ -0,0 +1,10 @@ +# PEcAn.DALEC 1.7.3.9000 + +## License change +* PEcAn.DALEC is now distributed under the BSD three-clause license instead of the NCSA Open Source license. + + +# PEcAn.DALEC 1.7.1 + +* All changes in 1.7.1 and earlier were recorded in a single file for all of the PEcAn packages; please see +https://github.com/PecanProject/pecan/blob/v1.7.1/CHANGELOG.md for details. diff --git a/models/dalec/R/met2model.DALEC.R b/models/dalec/R/met2model.DALEC.R index 242bfe61110..8658471f972 100644 --- a/models/dalec/R/met2model.DALEC.R +++ b/models/dalec/R/met2model.DALEC.R @@ -1,12 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2015 Boston University, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - # R Code to convert NetCDF CF met files into DALEC met files ## If files already exist in 'Outfolder', the default function is NOT to overwrite them and only diff --git a/models/dalec/R/model2netcdf.DALEC.R b/models/dalec/R/model2netcdf.DALEC.R index 71e7b9a9ef0..18be5fcb01f 100644 --- a/models/dalec/R/model2netcdf.DALEC.R +++ b/models/dalec/R/model2netcdf.DALEC.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2015 Boston University, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - -#--------------------------------------------------------------------------------------------------# ##' Convert DALEC output to netCDF ##' ##' Converts all output contained in a folder to netCDF. diff --git a/models/dalec/R/write.configs.dalec.R b/models/dalec/R/write.configs.dalec.R index 21e481c242a..863e5fc1ecf 100644 --- a/models/dalec/R/write.configs.dalec.R +++ b/models/dalec/R/write.configs.dalec.R @@ -1,12 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2015 Boston University, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - #--------------------------------------------------------------------------------------------------# # Template for functions to prepare and write out files model-specific configuration files for MA #--------------------------------------------------------------------------------------------------# diff --git a/models/ed/Dockerfile b/models/ed/Dockerfile index 282a5b5d391..a3873e896a7 100644 --- a/models/ed/Dockerfile +++ b/models/ed/Dockerfile @@ -4,15 +4,12 @@ ARG IMAGE_VERSION="latest" # ---------------------------------------------------------------------- # BUILD MODEL BINARY # ---------------------------------------------------------------------- -FROM pecan/models:${IMAGE_VERSION} as model-binary +FROM pecan/models:${IMAGE_VERSION} AS model-binary # Some variables that can be used to set control the docker build ARG MODEL_VERSION="2.2.0" ARG BINARY_VERSION="2.2" -# specify fortran compiler -ENV FC_TYPE=GNU - # install dependencies RUN apt-get update \ && apt-get install -y --no-install-recommends \ @@ -20,17 +17,16 @@ RUN apt-get update \ curl \ gfortran \ git \ - libhdf5-dev \ - libopenmpi-dev \ + libhdf5-openmpi-dev \ && rm -rf /var/lib/apt/lists/* # download, unzip and build ed2 WORKDIR /src -RUN git -c http.sslVerify=false clone https://github.com/EDmodel/ED2.git \ - && cd ED2/ED/build \ - && curl -o make/include.mk.VM http://isda.ncsa.illinois.edu/~kooper/EBI/include.mk.opt.`uname -s` \ +RUN git -c http.sslVerify=false clone https://github.com/EDmodel/ED2.git +COPY data-raw/include.mk.opt /src/ED2/ED/build/make/include.mk.pecan +RUN cd ED2/ED/build \ && if [ "${MODEL_VERSION}" != "git" ]; then git checkout "v.${MODEL_VERSION}"; fi \ - && ./install.sh -g -p VM \ + && ./install.sh -g -p pecan \ && mv /src/ED2/ED/build/ed_${BINARY_VERSION}-opt /src/ED2/ED/build/ed ######################################################################## @@ -46,7 +42,8 @@ FROM pecan/models:${IMAGE_VERSION} RUN apt-get update \ && apt-get install -y --no-install-recommends \ - libopenmpi3 \ + libhdf5-openmpi-103 \ + libgomp1 \ && rm -rf /var/lib/apt/lists/* # INSTALL PEcAn.ED2 diff --git a/models/ed/data-raw/include.mk.opt b/models/ed/data-raw/include.mk.opt new file mode 100644 index 00000000000..da68d2f1455 --- /dev/null +++ b/models/ed/data-raw/include.mk.opt @@ -0,0 +1,38 @@ +#Makefile include include.mk.opt.ubuntu +############################################################################ + +# Define make (gnu make works best). +MAKE=/usr/bin/make + +# libraries. +BASE=$(ED_ROOT)/build/ + +# HDF 5 Libraries +HDF5_INCS=-I/usr/include/hdf5/openmpi +HDF5_LIBS= -L/usr/lib/$(shell uname -m)-linux-gnu/hdf5/openmpi -lhdf5_fortran -lhdf5_hl -lhdf5 -lz -lm +USE_COLLECTIVE_MPIO=0 + +# interface +USE_INTERF=1 + +# gfortran +CMACH=PC_LINUX1 +FC_TYPE=GNU +F_COMP=mpif90.openmpi +F_OPTS=-O3 -ffree-line-length-none -frecursive -fopenmp -static +C_COMP=mpicc.openmpi +C_OPTS=-O0 -DLITTLE -g -static +LOADER=mpif90.openmpi +LOADER_OPTS=-O3 -ffree-line-length-none -frecursive -fopenmp +C_LOADER==mpicc.openmpi +LIBS= +MOD_EXT=mod + +# using MPI libraries: +MPI_PATH= +PAR_INCS= +PAR_LIBS= +PAR_DEFS= + +# For IBM,HP,SGI,ALPHA,LINUX use these: +ARCHIVE=ar rs diff --git a/models/jules/LICENSE b/models/jules/LICENSE index 5a9e44128f1..09ef35a60b4 100644 --- a/models/jules/LICENSE +++ b/models/jules/LICENSE @@ -1,34 +1,3 @@ -## This is the master copy of the PEcAn License - -University of Illinois/NCSA Open Source License - -Copyright (c) 2012, University of Illinois, NCSA. All rights reserved. - -PEcAn project -www.pecanproject.org - -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. - +YEAR: 2024 +COPYRIGHT HOLDER: PEcAn Project +ORGANIZATION: PEcAn Project, authors affiliations diff --git a/models/jules/NEWS.md b/models/jules/NEWS.md new file mode 100644 index 00000000000..3b5ab1d8d20 --- /dev/null +++ b/models/jules/NEWS.md @@ -0,0 +1,10 @@ +# PEcAn.JULES 1.7.3.9000 + +## License change +* PEcAn.JULES is now distributed under the BSD three-clause license instead of the NCSA Open Source license. + + +# PEcAn.JULES 1.7.1 + +* All changes in 1.7.1 and earlier were recorded in a single file for all of the PEcAn packages; please see +https://github.com/PecanProject/pecan/blob/v1.7.1/CHANGELOG.md for details. diff --git a/models/jules/R/model2netcdf.JULES.R b/models/jules/R/model2netcdf.JULES.R index 6270cb6da0c..733bef29e1b 100755 --- a/models/jules/R/model2netcdf.JULES.R +++ b/models/jules/R/model2netcdf.JULES.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - -##-------------------------------------------------------------------------------------------------# ##' Convert MODEL output into the PEcAn standard ##' ##' @name model2netcdf.JULES diff --git a/models/jules/R/write.config.JULES.R b/models/jules/R/write.config.JULES.R index f68cce831ac..1f01f7b60be 100644 --- a/models/jules/R/write.config.JULES.R +++ b/models/jules/R/write.config.JULES.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - -##-------------------------------------------------------------------------------------------------# ##' Writes a JULES config file. ##' ##' Requires a pft xml object, a list of trait values for a single model run, diff --git a/models/jules/tests/testthat.R b/models/jules/tests/testthat.R index 060471e6cbb..ba6e49d00b7 100644 --- a/models/jules/tests/testthat.R +++ b/models/jules/tests/testthat.R @@ -1,11 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- library(testthat) library(PEcAn.utils) diff --git a/models/linkages/LICENSE b/models/linkages/LICENSE index 5a9e44128f1..09ef35a60b4 100644 --- a/models/linkages/LICENSE +++ b/models/linkages/LICENSE @@ -1,34 +1,3 @@ -## This is the master copy of the PEcAn License - -University of Illinois/NCSA Open Source License - -Copyright (c) 2012, University of Illinois, NCSA. All rights reserved. - -PEcAn project -www.pecanproject.org - -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. - +YEAR: 2024 +COPYRIGHT HOLDER: PEcAn Project +ORGANIZATION: PEcAn Project, authors affiliations diff --git a/models/linkages/NEWS.md b/models/linkages/NEWS.md new file mode 100644 index 00000000000..0899764fc20 --- /dev/null +++ b/models/linkages/NEWS.md @@ -0,0 +1,10 @@ +# PEcAn.LINKAGES 1.7.3.9000 + +## License change +* PEcAn.LINKAGES is now distributed under the BSD three-clause license instead of the NCSA Open Source license. + + +# PEcAn.LINKAGES 1.7.1 + +* All changes in 1.7.1 and earlier were recorded in a single file for all of the PEcAn packages; please see +https://github.com/PecanProject/pecan/blob/v1.7.1/CHANGELOG.md for details. diff --git a/models/linkages/R/met2model.LINKAGES.R b/models/linkages/R/met2model.LINKAGES.R index 9d7c28136b7..f1db9f3e2b5 100644 --- a/models/linkages/R/met2model.LINKAGES.R +++ b/models/linkages/R/met2model.LINKAGES.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - -##-------------------------------------------------------------------------------------------------# ##' Converts a met CF file to a model specific met file. The input ##' files are calld /.YYYY.cf ##' diff --git a/models/linkages/R/model2netcdf.LINKAGES.R b/models/linkages/R/model2netcdf.LINKAGES.R index e2a059c3fec..a24b9f017f7 100644 --- a/models/linkages/R/model2netcdf.LINKAGES.R +++ b/models/linkages/R/model2netcdf.LINKAGES.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - -##-------------------------------------------------------------------------------------------------# ##' Convert MODEL output into the NACP Intercomparison format (ALMA using netCDF) ##' ##' @name model2netcdf.LINKAGES diff --git a/models/linkages/R/read_restart.LINKAGES.R b/models/linkages/R/read_restart.LINKAGES.R index c4173f888f1..c5d59f2957d 100644 --- a/models/linkages/R/read_restart.LINKAGES.R +++ b/models/linkages/R/read_restart.LINKAGES.R @@ -1,12 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - ##' @title read_restart.LINKAGES ##' @name read_restart.LINKAGES ##' @author Ann Raiho \email{araiho@@nd.edu} diff --git a/models/linkages/R/sample.IC.LINKAGES.R b/models/linkages/R/sample.IC.LINKAGES.R index 3c77427a5f2..0b278c74e55 100644 --- a/models/linkages/R/sample.IC.LINKAGES.R +++ b/models/linkages/R/sample.IC.LINKAGES.R @@ -1,12 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - sample.IC.LINKAGES <- function(ne, state, year = NULL) { ## g C * m-2 ground area in wood (above-ground + roots) biomass_tsca = ifelse(rep("biomass_tsca" %in% names(state), ne), diff --git a/models/linkages/R/spinup.LINKAGES.R b/models/linkages/R/spinup.LINKAGES.R index 1b9df3592e3..cff880fcf5a 100644 --- a/models/linkages/R/spinup.LINKAGES.R +++ b/models/linkages/R/spinup.LINKAGES.R @@ -1,12 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - spinup.LINKAGES <- function(start.year, end.year, temp.mat, precip.mat, paleon = NULL) { if (is.null(paleon)) { paleon <- TRUE # Why not just have `paleon = TRUE` above? diff --git a/models/linkages/R/split_inputs.LINKAGES.R b/models/linkages/R/split_inputs.LINKAGES.R index 142b9d64423..9be21c69ddb 100644 --- a/models/linkages/R/split_inputs.LINKAGES.R +++ b/models/linkages/R/split_inputs.LINKAGES.R @@ -1,10 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. All rights reserved. This program and the -# accompanying materials are made available under the terms of the University of Illinois/NCSA -# Open Source License which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - ##' @title split_inputs.LINKAGES ##' @name split_inputs.LINKAGES ##' @author Ann Raiho diff --git a/models/linkages/R/write.config.LINKAGES.R b/models/linkages/R/write.config.LINKAGES.R index b656d14f294..3cb2dec58fe 100644 --- a/models/linkages/R/write.config.LINKAGES.R +++ b/models/linkages/R/write.config.LINKAGES.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - -##-------------------------------------------------------------------------------------------------# ##' Writes a LINKAGES config file. ##' ##' Requires a pft xml object, a list of trait values for a single model run, diff --git a/models/linkages/R/write_restart.LINKAGES.R b/models/linkages/R/write_restart.LINKAGES.R index 77b073590b5..39b0a24cec4 100644 --- a/models/linkages/R/write_restart.LINKAGES.R +++ b/models/linkages/R/write_restart.LINKAGES.R @@ -1,12 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - ##' @title write_restart.LINKAGES ##' @name write_restart.LINKAGES ##' @author Ann Raiho \email{araiho@@nd.edu} diff --git a/models/linkages/tests/testthat.R b/models/linkages/tests/testthat.R index 15a638d15e9..bf752b76016 100644 --- a/models/linkages/tests/testthat.R +++ b/models/linkages/tests/testthat.R @@ -1,11 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- library(testthat) library(PEcAn.utils) diff --git a/models/lpjguess/LICENSE b/models/lpjguess/LICENSE index 5a9e44128f1..09ef35a60b4 100644 --- a/models/lpjguess/LICENSE +++ b/models/lpjguess/LICENSE @@ -1,34 +1,3 @@ -## This is the master copy of the PEcAn License - -University of Illinois/NCSA Open Source License - -Copyright (c) 2012, University of Illinois, NCSA. All rights reserved. - -PEcAn project -www.pecanproject.org - -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. - +YEAR: 2024 +COPYRIGHT HOLDER: PEcAn Project +ORGANIZATION: PEcAn Project, authors affiliations diff --git a/models/lpjguess/NEWS.md b/models/lpjguess/NEWS.md new file mode 100644 index 00000000000..63b168f3e3f --- /dev/null +++ b/models/lpjguess/NEWS.md @@ -0,0 +1,10 @@ +# PEcAn.LPJGUESS 1.7.3.9000 + +## License change +* PEcAn.LPJGUESS is now distributed under the BSD three-clause license instead of the NCSA Open Source license. + + +# PEcAn.LPJGUESS 1.7.1 + +* All changes in 1.7.1 and earlier were recorded in a single file for all of the PEcAn packages; please see +https://github.com/PecanProject/pecan/blob/v1.7.1/CHANGELOG.md for details. diff --git a/models/lpjguess/R/met2model.LPJGUESS.R b/models/lpjguess/R/met2model.LPJGUESS.R index 9b05a54db8f..3b719881d14 100644 --- a/models/lpjguess/R/met2model.LPJGUESS.R +++ b/models/lpjguess/R/met2model.LPJGUESS.R @@ -1,12 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - # R Code to convert NetCDF CF met files into LPJ-GUESS met files ## If files already exist in 'Outfolder', the default function is NOT to overwrite them and only diff --git a/models/lpjguess/R/model2netcdf.LPJGUESS.R b/models/lpjguess/R/model2netcdf.LPJGUESS.R index a92c343fb77..c5202833104 100644 --- a/models/lpjguess/R/model2netcdf.LPJGUESS.R +++ b/models/lpjguess/R/model2netcdf.LPJGUESS.R @@ -1,12 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - ##' Convert LPJ-GUESS output to netCDF ##' ##' @name model2netcdf.LPJGUESS diff --git a/models/lpjguess/R/readStateBinary.LPJGUESS.R b/models/lpjguess/R/readStateBinary.LPJGUESS.R index 89ffb0f5969..ffba146ac52 100644 --- a/models/lpjguess/R/readStateBinary.LPJGUESS.R +++ b/models/lpjguess/R/readStateBinary.LPJGUESS.R @@ -1,12 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - # R Code to convert NetCDF CF met files into LPJ-GUESS met files ## If files already exist in 'Outfolder', the default function is NOT to overwrite them and only diff --git a/models/lpjguess/R/write.config.LPJGUESS.R b/models/lpjguess/R/write.config.LPJGUESS.R index 8c5f900704f..c326edab6ec 100644 --- a/models/lpjguess/R/write.config.LPJGUESS.R +++ b/models/lpjguess/R/write.config.LPJGUESS.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - -##-------------------------------------------------------------------------------------------------# ##' Writes a LPJ-GUESS config file. ##' ##' Requires a pft xml object, a list of trait values for a single model run, diff --git a/models/lpjguess/tests/testthat.R b/models/lpjguess/tests/testthat.R index 59cf12a4475..481a3f96014 100644 --- a/models/lpjguess/tests/testthat.R +++ b/models/lpjguess/tests/testthat.R @@ -1,11 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- library(testthat) library(PEcAn.utils) diff --git a/models/maespa/Dockerfile b/models/maespa/Dockerfile index 0b5fbd1be54..22243dc3c1b 100644 --- a/models/maespa/Dockerfile +++ b/models/maespa/Dockerfile @@ -4,7 +4,7 @@ ARG IMAGE_VERSION="latest" # ---------------------------------------------------------------------- # BUILD MODEL BINARY # ---------------------------------------------------------------------- -FROM pecan/models:${IMAGE_VERSION} as model-binary +FROM pecan/models:${IMAGE_VERSION} AS model-binary # download, unzip and build ed2 WORKDIR /src diff --git a/models/maespa/R/write.config.MAESPA.R b/models/maespa/R/write.config.MAESPA.R index d88667480e8..7e1b21dfa2b 100755 --- a/models/maespa/R/write.config.MAESPA.R +++ b/models/maespa/R/write.config.MAESPA.R @@ -18,7 +18,7 @@ write.config.MAESPA <- function(defaults, trait.values, settings, run.id) { if(!require("Maeswrap")){ logger.severe("The Maeswrap package is not installed. Please consult PEcAn documentation for install notes: - https://pecanproject.github.io/pecan-documentation/master/pecan-models.html#maespa") + https://pecanproject.github.io/pecan-documentation/latest/pecan-models.html#maespa") } # find out where to write run/ouput diff --git a/models/preles/LICENSE b/models/preles/LICENSE index 5a9e44128f1..09ef35a60b4 100644 --- a/models/preles/LICENSE +++ b/models/preles/LICENSE @@ -1,34 +1,3 @@ -## This is the master copy of the PEcAn License - -University of Illinois/NCSA Open Source License - -Copyright (c) 2012, University of Illinois, NCSA. All rights reserved. - -PEcAn project -www.pecanproject.org - -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. - +YEAR: 2024 +COPYRIGHT HOLDER: PEcAn Project +ORGANIZATION: PEcAn Project, authors affiliations diff --git a/models/preles/NEWS.md b/models/preles/NEWS.md new file mode 100644 index 00000000000..460c0509e66 --- /dev/null +++ b/models/preles/NEWS.md @@ -0,0 +1,10 @@ +# PEcAn.PRELES 1.7.3.9000 + +## License change +* PEcAn.PRELES is now distributed under the BSD three-clause license instead of the NCSA Open Source license. + + +# PEcAn.PRELES 1.7.1 + +* All changes in 1.7.1 and earlier were recorded in a single file for all of the PEcAn packages; please see +https://github.com/PecanProject/pecan/blob/v1.7.1/CHANGELOG.md for details. diff --git a/models/preles/R/runPRELES.jobsh.R b/models/preles/R/runPRELES.jobsh.R index deb925a4b3a..26237e003d5 100644 --- a/models/preles/R/runPRELES.jobsh.R +++ b/models/preles/R/runPRELES.jobsh.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - -#--------------------------------------------------------------------------------------------------# ##' @title Function to process ncdf file, run PRELES model, and convert output .nc file in CF standard ##' @param in.path location on disk where inputs are stored ##' @param in.prefix prefix of input and output files diff --git a/models/preles/R/write.config.PRELES.R b/models/preles/R/write.config.PRELES.R index fb31d2e705d..9a7e6423247 100644 --- a/models/preles/R/write.config.PRELES.R +++ b/models/preles/R/write.config.PRELES.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - -##-------------------------------------------------------------------------------------------------# ##' Writes a PRELES config file. ##' ##' @name write.config.PRELES diff --git a/models/preles/tests/testthat.R b/models/preles/tests/testthat.R index 73f5a5f9fb8..4d3ef970446 100644 --- a/models/preles/tests/testthat.R +++ b/models/preles/tests/testthat.R @@ -1,11 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- library(testthat) library(PEcAn.utils) diff --git a/models/sibcasa/R/met2model.SIBCASA.R b/models/sibcasa/R/met2model.SIBCASA.R index b0e57c707cb..5dc81323f70 100644 --- a/models/sibcasa/R/met2model.SIBCASA.R +++ b/models/sibcasa/R/met2model.SIBCASA.R @@ -16,7 +16,7 @@ met2model.SIBCASA <- function(in.path, in.prefix, outfolder, overwrite = FALSE) PEcAn.logger::logger.severe("NOT IMPLEMENTED") # Please follow the PEcAn style guide: - # https://pecanproject.github.io/pecan-documentation/master/coding-style.html + # https://pecanproject.github.io/pecan-documentation/latest/coding-style.html # Note that `library()` calls should _never_ appear here; instead, put # packages dependencies in the DESCRIPTION file, under "Imports:". diff --git a/models/sipnet/Dockerfile b/models/sipnet/Dockerfile index 1b0fc75725e..d69e845dd4d 100644 --- a/models/sipnet/Dockerfile +++ b/models/sipnet/Dockerfile @@ -4,7 +4,7 @@ ARG IMAGE_VERSION="latest" # ---------------------------------------------------------------------- # BUILD SIPNET BINARY # ---------------------------------------------------------------------- -FROM pecan/models:${IMAGE_VERSION} as model-binary +FROM pecan/models:${IMAGE_VERSION} AS model-binary # Some variables that can be used to set control the docker build ARG MODEL_VERSION=git diff --git a/models/sipnet/LICENSE b/models/sipnet/LICENSE index 5a9e44128f1..09ef35a60b4 100644 --- a/models/sipnet/LICENSE +++ b/models/sipnet/LICENSE @@ -1,34 +1,3 @@ -## This is the master copy of the PEcAn License - -University of Illinois/NCSA Open Source License - -Copyright (c) 2012, University of Illinois, NCSA. All rights reserved. - -PEcAn project -www.pecanproject.org - -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. - +YEAR: 2024 +COPYRIGHT HOLDER: PEcAn Project +ORGANIZATION: PEcAn Project, authors affiliations diff --git a/models/sipnet/NEWS.md b/models/sipnet/NEWS.md new file mode 100644 index 00000000000..e79578461af --- /dev/null +++ b/models/sipnet/NEWS.md @@ -0,0 +1,13 @@ +# PEcAn.SIPNET 1.8.0.9000 + +## License change +* PEcAn.SIPNET is now distributed under the BSD three-clause license instead of the NCSA Open Source license. + +# PEcAn.SIPNET 1.8.0 + +* Support for all Sipnet variables in read_restart and write_restart, for integration with state data assimilation workflows + +# PEcAn.SIPNET 1.7.1 + +* All changes in 1.7.1 and earlier were recorded in a single file for all of the PEcAn packages; please see +https://github.com/PecanProject/pecan/blob/v1.7.1/CHANGELOG.md for details. diff --git a/models/sipnet/R/met2model.SIPNET.R b/models/sipnet/R/met2model.SIPNET.R index 1334e284317..919137eadbf 100644 --- a/models/sipnet/R/met2model.SIPNET.R +++ b/models/sipnet/R/met2model.SIPNET.R @@ -1,13 +1,3 @@ - -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - # R Code to convert NetCDF CF met files into SIPNET met files ## If files already exist in 'Outfolder', the default function is NOT to overwrite them and only diff --git a/models/sipnet/R/model2netcdf.SIPNET.R b/models/sipnet/R/model2netcdf.SIPNET.R index ca01fff0814..96a2b016abc 100644 --- a/models/sipnet/R/model2netcdf.SIPNET.R +++ b/models/sipnet/R/model2netcdf.SIPNET.R @@ -1,12 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - #' Merge multiple NetCDF files into one #' #' @param files \code{character}. List of filepaths, which should lead to NetCDF files. diff --git a/models/sipnet/R/read_restart.SIPNET.R b/models/sipnet/R/read_restart.SIPNET.R index adda2f55716..2260c71a476 100755 --- a/models/sipnet/R/read_restart.SIPNET.R +++ b/models/sipnet/R/read_restart.SIPNET.R @@ -1,12 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - ##' @title Read restart function for SDA with SIPNET ##' ##' @author Ann Raiho \email{araiho@@nd.edu} diff --git a/models/sipnet/R/sample.IC.SIPNET.R b/models/sipnet/R/sample.IC.SIPNET.R index d1578c4df33..0a68647d4fc 100644 --- a/models/sipnet/R/sample.IC.SIPNET.R +++ b/models/sipnet/R/sample.IC.SIPNET.R @@ -1,12 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - ## samples intial conditions for SIPNET ##' @title sample.IC.SIPNET ##' @name sample.IC.SIPNET diff --git a/models/sipnet/R/split_inputs.SIPNET.R b/models/sipnet/R/split_inputs.SIPNET.R index cd674647817..b47289d567a 100644 --- a/models/sipnet/R/split_inputs.SIPNET.R +++ b/models/sipnet/R/split_inputs.SIPNET.R @@ -1,12 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - ## split clim file into smaller time units to use in KF ##' @title split_inputs.SIPNET ##' @name split_inputs.SIPNET diff --git a/models/sipnet/R/write.configs.SIPNET.R b/models/sipnet/R/write.configs.SIPNET.R index ffa65a5ee62..c294808b7b5 100755 --- a/models/sipnet/R/write.configs.SIPNET.R +++ b/models/sipnet/R/write.configs.SIPNET.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - -#--------------------------------------------------------------------------------------------------# ##' Writes a configuration files for your model ##' @name write.config.SIPNET ##' @title Writes a configuration files for SIPNET model diff --git a/models/sipnet/R/write_restart.SIPNET.R b/models/sipnet/R/write_restart.SIPNET.R index 455266f971e..6bd62c3b3a7 100755 --- a/models/sipnet/R/write_restart.SIPNET.R +++ b/models/sipnet/R/write_restart.SIPNET.R @@ -1,12 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- - ##' @title write_restart.SIPNET ##' @name write_restart.SIPNET ##' @author Ann Raiho \email{araiho@@nd.edu} diff --git a/models/sipnet/tests/testthat.R b/models/sipnet/tests/testthat.R index 339f0c32a30..7a1fc04289f 100644 --- a/models/sipnet/tests/testthat.R +++ b/models/sipnet/tests/testthat.R @@ -1,11 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- library(testthat) library(PEcAn.utils) diff --git a/models/template/R/met2model.MODEL.R b/models/template/R/met2model.MODEL.R index 5846976b72c..2d3f7012e33 100644 --- a/models/template/R/met2model.MODEL.R +++ b/models/template/R/met2model.MODEL.R @@ -15,7 +15,7 @@ met2model.MODEL <- function(in.path, in.prefix, outfolder, overwrite = FALSE) { PEcAn.logger::logger.severe("NOT IMPLEMENTED") # Please follow the PEcAn style guide: - # https://pecanproject.github.io/pecan-documentation/master/coding-style.html + # https://pecanproject.github.io/pecan-documentation/latest/coding-style.html # Note that `library()` calls should _never_ appear here; instead, put # packages dependencies in the DESCRIPTION file, under "Imports:". diff --git a/modules/allometry/LICENSE b/modules/allometry/LICENSE index 9e38c2dc685..09ef35a60b4 100644 --- a/modules/allometry/LICENSE +++ b/modules/allometry/LICENSE @@ -1,29 +1,3 @@ -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. - +YEAR: 2024 +COPYRIGHT HOLDER: PEcAn Project +ORGANIZATION: PEcAn Project, authors affiliations diff --git a/modules/allometry/NEWS.md b/modules/allometry/NEWS.md new file mode 100644 index 00000000000..d0bcb027c0d --- /dev/null +++ b/modules/allometry/NEWS.md @@ -0,0 +1,10 @@ +# PEcAn.allometry 1.7.2.9000 + +## License change +* PEcAn.allometry is now distributed under the BSD three-clause license instead of the NCSA Open Source license. + + +# PEcAn.allometry 1.7.1 + +* All changes in 1.7.1 and earlier were recorded in a single file for all of the PEcAn packages; please see +https://github.com/PecanProject/pecan/blob/v1.7.1/CHANGELOG.md for details. diff --git a/modules/allometry/R/AllomAve.R b/modules/allometry/R/AllomAve.R index af297be4d7c..357da3edb19 100644 --- a/modules/allometry/R/AllomAve.R +++ b/modules/allometry/R/AllomAve.R @@ -1,11 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- #' AllomAve #' diff --git a/modules/allometry/R/allom.BayesFit.R b/modules/allometry/R/allom.BayesFit.R index 7ddc1011ac2..91e92022435 100644 --- a/modules/allometry/R/allom.BayesFit.R +++ b/modules/allometry/R/allom.BayesFit.R @@ -1,11 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2015 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- #' allom.BayesFit #' diff --git a/modules/allometry/R/allom.predict.R b/modules/allometry/R/allom.predict.R index 2423fc283db..ea94f83526f 100644 --- a/modules/allometry/R/allom.predict.R +++ b/modules/allometry/R/allom.predict.R @@ -1,11 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2015 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- #' allom.predict #' diff --git a/modules/allometry/R/query.allom.data.R b/modules/allometry/R/query.allom.data.R index 8234e0b2dfd..26eb0ed8aac 100644 --- a/modules/allometry/R/query.allom.data.R +++ b/modules/allometry/R/query.allom.data.R @@ -1,11 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- #' query.allom.data #' diff --git a/modules/allometry/R/read.allom.data.R b/modules/allometry/R/read.allom.data.R index 09c560d1c63..8b48962a9dc 100644 --- a/modules/allometry/R/read.allom.data.R +++ b/modules/allometry/R/read.allom.data.R @@ -1,11 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2015 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- #' read.allom.data #' diff --git a/modules/allometry/tests/testthat.R b/modules/allometry/tests/testthat.R index a775e051786..4194358dc88 100644 --- a/modules/allometry/tests/testthat.R +++ b/modules/allometry/tests/testthat.R @@ -1,11 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2012 University of Illinois, NCSA. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the -# University of Illinois/NCSA Open Source License -# which accompanies this distribution, and is available at -# http://opensource.ncsa.illinois.edu/license.html -#------------------------------------------------------------------------------- library(testthat) library(PEcAn.utils) diff --git a/modules/allometry/vignettes/AllomVignette.Rmd b/modules/allometry/vignettes/AllomVignette.Rmd index 111a4d982df..2add42100b5 100644 --- a/modules/allometry/vignettes/AllomVignette.Rmd +++ b/modules/allometry/vignettes/AllomVignette.Rmd @@ -2,7 +2,7 @@ title: "PEcAn.allometry Vignette" author: "Mike Dietze" date: "April 23, 2015" -output: html_document +output: html_vignette vignette: > %\VignetteIndexEntry{PEcAn.allometry Vignette} %\VignetteEngine{knitr::rmarkdown} diff --git a/modules/assim.batch/LICENSE b/modules/assim.batch/LICENSE index 9e38c2dc685..09ef35a60b4 100644 --- a/modules/assim.batch/LICENSE +++ b/modules/assim.batch/LICENSE @@ -1,29 +1,3 @@ -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. - +YEAR: 2024 +COPYRIGHT HOLDER: PEcAn Project +ORGANIZATION: PEcAn Project, authors affiliations diff --git a/modules/assim.batch/NEWS.md b/modules/assim.batch/NEWS.md index d1c0b35b72c..2e34eecf11e 100644 --- a/modules/assim.batch/NEWS.md +++ b/modules/assim.batch/NEWS.md @@ -1,5 +1,7 @@ # PEcAn.assim.batch 1.8.0.9000 +## License change +* PEcAn.assim.batch is now distributed under the BSD three-clause license instead of the NCSA Open Source license. # PEcAn.assim.batch 1.8.0 diff --git a/modules/assim.sequential/inst/NEFI/README.html b/modules/assim.sequential/inst/NEFI/README.html index 6c67d52b5fe..db88d350e13 100644 --- a/modules/assim.sequential/inst/NEFI/README.html +++ b/modules/assim.sequential/inst/NEFI/README.html @@ -38,7 +38,7 @@ }; - diff --git a/web/04-runpecan.php b/web/04-runpecan.php index c2cf6407753..039ac52654e 100644 --- a/web/04-runpecan.php +++ b/web/04-runpecan.php @@ -42,7 +42,6 @@ $offline=isset($_REQUEST['offline']); $pecan_edit=isset($_REQUEST['pecan_edit']); $model_edit=isset($_REQUEST['model_edit']); -$browndog=isset($_REQUEST['browndog']); $qsub=isset($_REQUEST['qsub']); # parameters @@ -284,13 +283,6 @@ fwrite($fh, " {$dbfiles_folder}" . PHP_EOL); fwrite($fh, " " . PHP_EOL); -if ($browndog) { - fwrite($fh, " " . PHP_EOL); - fwrite($fh, " {$browndog_url}" . PHP_EOL); - fwrite($fh, " {$browndog_username}" . PHP_EOL); - fwrite($fh, " {$browndog_password}" . PHP_EOL); - fwrite($fh, " " . PHP_EOL); -} fwrite($fh, " " . PHP_EOL); foreach($pft as $p) { diff --git a/web/05-running.php b/web/05-running.php index 90573690104..5d347bfe672 100644 --- a/web/05-running.php +++ b/web/05-running.php @@ -184,12 +184,7 @@ function refresh() { foreach ($status as $line) { $data = explode("\t", $line); echo " \n"; - if ($data[0] == "BrownDog") { - echo " "; - echo "{$data[0]} \"BrownDog\"\n"; - } else { - echo " {$data[0]}\n"; - } + echo " {$data[0]}\n"; if (count($data) >= 2) { echo " {$data[1]}\n"; } else { diff --git a/web/07-analysis.php b/web/07-analysis.php index 61e62a22f3e..53247a49200 100644 --- a/web/07-analysis.php +++ b/web/07-analysis.php @@ -33,7 +33,6 @@ $pecan_edit = (isset($_REQUEST['pecan_edit'])) ? "checked" : ""; $adv_setup = (isset($_REQUEST['adv_setup'])) ? "checked" : ""; $model_edit = (isset($_REQUEST['model_edit'])) ? "checked" : ""; -$browndog = (isset($_REQUEST['browndog'])) ? "checked" : ""; $ensemble_analysis = (isset($_REQUEST['ensemble_analsysis'])) ? "checked" : ""; $sensitivity_analysis = (isset($_REQUEST['sensitivity'])) ? "checked" : ""; @@ -228,7 +227,7 @@ function nextStep() {
- + " onChange="validate();"/>
@@ -263,16 +262,6 @@ function nextStep() { - - diff --git a/web/08-finished.php b/web/08-finished.php index 2d295ee1805..f2ae1b54b7f 100644 --- a/web/08-finished.php +++ b/web/08-finished.php @@ -546,7 +546,7 @@ function startsWith(haystack, needle) {

- Documentation + Documentation
Chat Room
@@ -571,12 +571,7 @@ function startsWith(haystack, needle) { foreach ($status as $line) { $data = explode("\t", $line); echo " \n"; - if ($data[0] == "BrownDog") { - echo " "; - echo "{$data[0]} \"BrownDog\"\n"; - } else { - echo " {$data[0]}\n"; - } + echo " {$data[0]}\n"; if (count($data) >= 2) { echo " {$data[1]}\n"; } else { diff --git a/web/common.php b/web/common.php index d1ca30f225b..0f69d769e07 100644 --- a/web/common.php +++ b/web/common.php @@ -42,7 +42,7 @@ function left_footer() { ?>

- Documentation + Documentation
Chat Room
diff --git a/web/config.example.php b/web/config.example.php index 30cda27f783..7243b53cd46 100644 --- a/web/config.example.php +++ b/web/config.example.php @@ -16,10 +16,6 @@ $db_fia_password=""; $db_fia_database=""; -# browdog information -$browndog_url=""; -$browndog_username=""; -$browndog_password=""; # R binary $Rbinary="/usr/bin/R"; diff --git a/web/js/browndog.js b/web/js/browndog.js deleted file mode 100644 index 79958a07e25..00000000000 --- a/web/js/browndog.js +++ /dev/null @@ -1,52 +0,0 @@ -//Brown Dog graph -function browndog_add() { - var node = document.getElementById("browndog_img"); - if (node) return; - - var graphic = $("") - .attr("src", "images/browndog-small-transparent.gif") - .attr("width", "25") - .attr("id", "browndog_img") - .css("position", "absolute") - .css("left", "0px") - .css("bottom", "45px"); - $("body").append(graphic); - - setTimeout(browndog_run, 10); -} - -function browndog_del() { - var node = document.getElementById("browndog_img"); - node.parentNode.removeChild(node); - - node = document.getElementById("browndog_poweredby"); - node.parentNode.removeChild(node); -} - -function browndog_run() { - var graphic = document.getElementById("browndog_img"); - graphic.style.left = parseInt(graphic.style.left) + 25 + "px"; - - if (parseInt(graphic.style.left) < $(window).width() - 50) { - setTimeout(browndog_run, 10); - } else { - //graphic.remove(); - graphic.parentNode.removeChild(graphic); - - //Add powered by graphic - graphic = $("") - .attr("src", "images/poweredby-transparent.gif") - .attr("id", "browndog_img") - .attr("width", "100"); - - var link = $("") - .attr("href", "http://browndog.ncsa.illinois.edu") - .attr("id", "browndog_poweredby") - .css("position", "fixed") - .css("right", "10px") - .css("bottom", "30px") - .append(graphic); - - $("body").append(link); - } -} diff --git a/web/setups/core.php b/web/setups/core.php index f93c98ac100..467c51858df 100644 --- a/web/setups/core.php +++ b/web/setups/core.php @@ -26,7 +26,6 @@ switch ($key) { case 'all': $pattern = '/^\$/i'; break; // not working properly - case 'browndog': $pattern = '/\$browndog*/i'; break; case 'database': $pattern = '/\$db_bety_*/i'; break; case 'fiadb': $pattern = '/\$db_fia_*/i'; break; case 'client_sceret': $pattern = '/\$client_sceret*/i'; break; diff --git a/web/setups/page.template.php b/web/setups/page.template.php index c2e3486c1c9..8ef5f641b48 100644 --- a/web/setups/page.template.php +++ b/web/setups/page.template.php @@ -42,7 +42,6 @@

This is the Admin Pages.

List of available configurations

Database
- Browndog
FIA Database
Change Password