From 545a7caa20ae646f19e138058b30cff7f69d1c6c Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Feret Date: Wed, 3 Jan 2024 09:31:32 +0100 Subject: [PATCH] minor update - update CI - update news - update paper --- .github/workflows/R-CMD-check.yaml | 32 ++++++++++++++++++ .github/workflows/main_Rtest.yml | 54 ------------------------------ .gitlab-ci.yml | 19 ----------- NEWS.md | 1 + paper/paper.md | 18 ++++++---- 5 files changed, 45 insertions(+), 79 deletions(-) create mode 100644 .github/workflows/R-CMD-check.yaml delete mode 100644 .github/workflows/main_Rtest.yml diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..e7ad052 --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,32 @@ +# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag. +# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions +on: + push: + branches: + - main + - master + pull_request: + branches: + - main + - master + +name: R-CMD-check + +jobs: + R-CMD-check: + runs-on: macOS-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v2 + - uses: r-lib/actions/setup-r@v1 + - name: Install dependencies + run: | + install.packages(c("remotes", "rcmdcheck")) + remotes::install_deps(dependencies = TRUE) + shell: Rscript {0} + - name: Check + run: | + options(crayon.enabled = TRUE) + rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error") + shell: Rscript {0} diff --git a/.github/workflows/main_Rtest.yml b/.github/workflows/main_Rtest.yml deleted file mode 100644 index bda0485..0000000 --- a/.github/workflows/main_Rtest.yml +++ /dev/null @@ -1,54 +0,0 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples -# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help -on: - push: - branches: [main] - pull_request: - branches: [main] - -name: test-coverage - -jobs: - test-coverage: - runs-on: ubuntu-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - name: R - steps: - - uses: actions/checkout@v3 - - name: Setup R - uses: r-lib/actions/setup-r@v2 - with: - use-public-rspm: true - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - extra-packages: | - any::covr - any::rcmdcheck - needs: | - coverage - check - working-directory: 'prospect' - - name: Test coverage - run: | - covr::codecov( - quiet = FALSE, - clean = FALSE, - path = "prospect", - install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package") - ) - shell: Rscript {0} - - - name: Show testthat output - if: always() - run: | - ## -------------------------------------------------------------------- - find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true - shell: bash - - - name: Upload test results - if: failure() - uses: actions/upload-artifact@v3 - with: - name: coverage-test-failures - path: ${{ runner.temp }}/package \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 82d7d81..855b668 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,7 +26,6 @@ before_script: stages: - deps - check -- test - deploy deps: @@ -46,24 +45,6 @@ check: - master - schedules -test: - stage: test - script: - - R -e "devtools::install_deps(dependencies = TRUE)" - - R CMD build . --no-build-vignettes --no-manual - - PKG_FILE_NAME=$(ls -1t *.tar.gz | head -n 1) - - R CMD check "${PKG_FILE_NAME}" --no-build-vignettes --no-manual - cache: - key: "$CI_COMMIT_REF_SLUG" - paths: - - installed_deps/ - artifacts: - paths: - - '*.Rcheck/' - only: - - master - - pages: stage: deploy script: diff --git a/NEWS.md b/NEWS.md index 0bd16ce..c4b9588 100644 --- a/NEWS.md +++ b/NEWS.md @@ -10,6 +10,7 @@ version following reviews for publication in JOSS - add CONTRIBUTION.md and CODE_OF_CONDUCT.md (Issue#8: Add contribution guide) - update documentation and harmonize with corresponding code for JOSS manuscript (Issue#10: harmonize web tutorial with JOSS manuscript examples) - overall update of the code to work with dataframes more systematically +- only two versions now defined in the package (D and PRO), and the use of brown pigments is accessible during inversion by setting Est_Brown_Pigments == TRUE ## fixes - fixed error occuring when PROSPECT-PRO inversion performed to assess EWT diff --git a/paper/paper.md b/paper/paper.md index 6e86157..0ffd4aa 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -164,7 +164,8 @@ They are accessible through the variable `SpecPROSPECT_FullRange`, a data frame which is automatically loaded with the package. Multiple functions in the package `prospect` expect a variable `SpecPROSPECT` as input. `SpecPROSPECT_FullRange` is used as default value when this input variable is not defined. -Users can create a new variable and modify the spectral domain from `SpecPROSPECT_FullRange`. +Users can adjust `SpecPROSPECT_FullRange` in order to adjust the spectral characteristics +for simulation, including spectral domain, sampling or sensor-specicif spectral response. These two examples illustrate how to run PROSPECT. The function `PROSPECT` identifies the version to be used: PROSPECT-D is used @@ -246,10 +247,9 @@ library(data.table) # download ANGERS leaf optics database from gitlab repository gitlab_Rep <- 'https://gitlab.com/jbferet/myshareddata/raw/master/LOP' # download leaf biochemical constituents and leaf optical properties -fileName <- list('DataBioch.txt','ReflectanceData.txt','TransmittanceData.txt') -DataBioch <- data.table::fread(file.path(gitlab_Rep,'ANGERS',fileName[[1]])) -Refl<- data.table::fread(file.path(gitlab_Rep,'ANGERS',fileName[[2]])) -Tran <- data.table::fread(file.path(gitlab_Rep,'ANGERS',fileName[[3]])) +DataBioch <- data.table::fread(file.path(gitlab_Rep,'ANGERS/DataBioch.txt')) +Refl<- data.table::fread(file.path(gitlab_Rep,'ANGERS/ReflectanceData.txt')) +Tran <- data.table::fread(file.path(gitlab_Rep,'ANGERS/TransmittanceData.txt')) # Get the wavelengths corresponding to reflectance and transmittance measurements lambda <- Refl$wavelength Refl$wavelength <- Tran$wavelength <- NULL @@ -285,7 +285,7 @@ This list of parameters is defined with the variable `Parms2Estimate`. The default parameterization of PROSPECT inversion assesses all parmeters listed in Table \ref{table:1} except BROWN, which can be assessed by setting `Est_Brown_Pigments = TRUE` as input for `Invert_PROSPECT`. -The value set for parameters which are not estimated is then defined with +The value set for parameters which are not assessed is then defined with the `InitValues` input variable. ```r @@ -329,6 +329,11 @@ constituent content either from directional-hemispherical reflectance and transmittance, or from reflectance or transmittance only. `prospect` provides latest advances in terms of model version and inversion procedures to the leaf spectroscopy community. +`prospect` is coupled with the canopy model SAIL through the R package [`prosail`](https://jbferet.gitlab.io/prosail/index.html). +`prosail` is dedicated to applications focusing on Earth observation imagery analysis +and allows simulation of canopy reflectance for multispectral and hyperspectral sensors. +Hybrid inversions based on physical modeling and machine learning are also implemented +in `prosail` to assess vegetation traits from imagery data. # Availability @@ -347,3 +352,4 @@ We also warmly thank Luc Bidel, Christophe François and Gabriel Pavan who collected the ANGERS data set. # References +0 \ No newline at end of file