Skip to content

Commit

Permalink
Merge pull request #355 from NIEHS/pipeline-compact
Browse files Browse the repository at this point in the history
0.4.0
  • Loading branch information
mitchellmanware authored Aug 20, 2024
2 parents 61a2f73 + 02fd18e commit 341987a
Show file tree
Hide file tree
Showing 135 changed files with 9,508 additions and 10,582 deletions.
7 changes: 6 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
^vignettes/
^tests/
^input/
^tools/
Expand All @@ -18,10 +17,16 @@ input/*
inst/targets-wide
^.future/
^_targets/
_targets.R
_targets.yaml
\*.Rproj
\.out$
\.err$
\.sif$
\.log$
\.vscode
\.qmd$
\.sh$
R/reserved.R
^doc$
^Meta$
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*.csv filter=lfs diff=lfs merge=lfs -text
*.nc filter=lfs diff=lfs merge=lfs -text

input/** linguist-generated
inst/extdata/aqs_88101_2022.qs filter=lfs diff=lfs merge=lfs -text
12 changes: 11 additions & 1 deletion .github/workflows/check-standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,19 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck, any::remotes, any::units, any::rmarkdown
extra-packages: |
any::rcmdcheck
any::remotes
any::units
any::rmarkdown
needs: check

- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: install remote packages
run: |
Rscript -e 'remotes::install_github(sprintf("NIEHS/%s", c("amadeus", "chopin")), upgrade = FALSE)'
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,16 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
extra-packages: |
any::pkgdown,
local::.
needs: website

- name: install remote packages
run: |
Rscript -e 'remotes::install_github(sprintf("NIEHS/%s", c("amadeus", "chopin")), upgrade = FALSE)'
shell: bash

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}
Expand Down
66 changes: 23 additions & 43 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,11 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr, any::remotes
extra-packages: any::covr, any::DT, any::htmltools
needs: coverage

- name: install remote packages
run: |
Rscript -e 'remotes::install_github(sprintf("NIEHS/%s", c("amadeus", "chopin")), upgrade = FALSE)'
shell: bash

- name: Cache C++ and R dependencies
uses: actions/cache@v4
uses: actions/cache@v2
with:
path: |
~/.cache/R
Expand All @@ -43,66 +38,51 @@ jobs:
dependencies-${{ runner.os }}-
- name: Test coverage
run: >
Rscript -e
"covd<-covr::coverage_to_list()$totalcoverage;
run: |
Rscript -e "covpack<-covr::package_coverage(install_path='${{ github.workspace }}/cov', clean=FALSE); \
covr::report(covpack, file = file.path('${{ github.workspace }}', 'chopin-coverage-report.html')); \
covd<-covr::coverage_to_list(covpack)$totalcoverage; \
write.table(covd[length(covd)], file = '${{ github.workspace }}/local_cov.Rout', row.names = F, col.names = F)"
shell: bash

- name: Upload covr report as artifact
uses: actions/upload-artifact@v4
with:
name: covr-report
path: ${{ github.workspace }}/beethoven-coverage-report.html

- name: Upload workspace dump as artifact if the test fails
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: test-outputs
path: ${{ github.workspace }}/**

- name: Get Values
id: get-values
shell: bash
run: |
COV=$(cat ${{ github.workspace }}/local_cov.Rout)
echo "Patch coverage read from local_cov.Rout: $COV"
echo "coverage=$COV" >> $GITHUB_OUTPUT
- name: Checkout gh-pages
uses: actions/checkout@v4
with:
ref: gh-pages

- name: Patch comparison
id: patch-comparison
shell: bash
run: |
cov_patch="${{ steps.get-values.outputs.coverage }}"
if [[ ! -f cov_current.Rout ]]; then
cov_current=0
else
cov_current=$(cat cov_current.Rout)
fi
echo "Current coverage: $cov_current"
if (( $(echo "$cov_patch >= $cov_current" | bc -l) )); then
echo "Patch coverage ($cov_patch) is greater than or equal to current coverage ($cov_current)."
echo "cov_update=$cov_patch" >> $GITHUB_OUTPUT
else
echo "Patch coverage ($cov_patch) is less than current coverage ($cov_current)."
exit 1
fi
- name: Overwrite cov_current.Rout
if: ${{ github.event_name == 'push' }}
shell: bash
run: |
cov_update="${{ steps.patch-comparison.outputs.cov_update }}"
touch cov_current.Rout
echo "$cov_update" > cov_current.Rout

- name: Create Badges
shell: bash
run: |
npm i -g badgen-cli
export COV=${{ steps.get-values.outputs.coverage }}
COLOR=$(node -p '+process.env.COV >= 95 ? `green` : `yellow`')
COLOR=$(node -p '+process.env.COV >= 95 ? `green` : `orange`')
mkdir -p badges
badgen -j coverage -s $COV% -c $COLOR > badges/coverage.svg
- name: Deploy Badges
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Update badges [skip ci] & cov_current.Rout"
commit_message: "Update badges [skip ci]"
branch: gh-pages
skip_fetch: true
skip_checkout: true
Expand All @@ -113,4 +93,4 @@ jobs:
- name: Checkout Back
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
ref: ${{ github.ref }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,5 @@ slurm_error.log

# Apptainer images
**/*.sif
/Meta/
/doc/
2 changes: 1 addition & 1 deletion .lintr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ linters: linters_with_defaults(
commented_code_linter = NULL
)
exclusions: list(
"tests/testthat/test-download_functions.R",
"tests",
"inst",
"_targets.R"
)
27 changes: 16 additions & 11 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: beethoven
Title: Building an Extensible, rEproducible, Test-driven, Harmonized, Open-source, Versioned, ENsemble model for air quality
Version: 0.3.5
Version: 0.4.0
Authors@R: c(
person("Kyle", "Messier", , "kyle.messier@nih.gov", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-9508-9623")),
person("Insang", "Song", role = c("aut", "ctb"), comment = c(ORCID = "0000-0001-8732-3256")),
Expand All @@ -16,24 +16,23 @@ Authors@R: c(
Description: Near Real Time air pollution model results and code produced by the SET group. It is fully tested, versioned, and open source and open access.
Depends: R (>= 4.1.0)
Imports:
amadeus,
dplyr,
sf,
stats,
terra,
methods,
BART,
data.table,
future,
targets,
tune (>= 1.2.1),
rlang,
rsample,
spatialsample,
tidyr,
tidyselect,
yardstick,
bonsai,
lightgbm,
vetiver,
torch,
workflows,
recipes,
missRanger,
Expand All @@ -43,19 +42,25 @@ Imports:
anticlust,
qs,
stringi,
tibble,
collapse,
tigris,
graphics
graphics,
scatterplot3d
Suggests:
testthat (>= 3.0.0),
covr,
withr,
tarchetypes,
tidymodels,
xgboost,
torch,
bonsai,
brulee,
glmnet,
lightgbm,
scoringRules,
future.mirai,
xgboost (<= 2.0.3.1),
vetiver,
tarchetypes,
tidymodels,
knitr,
rmarkdown,
stars,
Expand All @@ -64,10 +69,10 @@ Suggests:
FNN,
ggplot2,
doRNG,
scatterplot3d,
furrr,
quarto
Remotes: NIEHS/amadeus, NIEHS/chopin
SystemRequirements: NetCDF4, CUDA (>= 10.0)
Encoding: UTF-8
VignetteBuilder: knitr, rmarkdown
Roxygen: list(markdown = TRUE)
Expand Down
Loading

0 comments on commit 341987a

Please sign in to comment.