Skip to content

Commit

Permalink
Merge branch 'r-sharp-r6' into pksim-installation-vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
Felixmil authored Jul 17, 2024
2 parents aee056f + 6850882 commit b864fee
Show file tree
Hide file tree
Showing 225 changed files with 5,126 additions and 2,563 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ tests\^spelling
^BinaryFiles$
^README\.Rmd$
^vignettes/images/simulation_lifecycle_flowcharts\.drawio$
^update_core_files.R
^\.github$
^codecov\.yml$
75 changes: 75 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# 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:
workflow_call:

name: R-CMD-check

permissions: read-all

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
# - {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
# - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
# - {os: ubuntu-latest, r: 'oldrel-1'}

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

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
error-on: 'c("error")'

- name: Build package
if: ${{ success() }}
run: |
output_dir <- file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "built_package")
dir.create(output_dir)
devtools::build(binary = TRUE, path = output_dir)
shell: Rscript {0}

- name: Get package version from DESCRIPTION file and set as environment variable
run: |
echo "PKG_VERSION=$(grep -oP '(?<=Version: )\d+\.\d+\.\d+\.*\d*' DESCRIPTION)" >> $GITHUB_ENV
shell: bash

- name: get R version and set as environment variable
run: |
echo "R_VERSION=$(Rscript -e 'cat(R.version$major, R.version$minor, sep = ".")')" >> $GITHUB_ENV
shell: bash

- name: Upload built package
if: ${{ success() }}
uses: actions/upload-artifact@v4
with:
name: ospsuite-v${{ env.PKG_VERSION }}-${{runner.os}}-r_${{ env.R_VERSION }}
path: ${{ runner.temp }}/built_package/*
42 changes: 15 additions & 27 deletions .github/workflows/main-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,23 @@ jobs:
uses: ./.github/workflows/bump-dev-version.yaml
secrets: inherit

R-CMD-Check:
if: ${{ always() }}
update-core-files:
if: ${{ !cancelled() && github.event_name == 'pull_request' }}
needs: [bump-dev-version]
uses: Open-Systems-Pharmacology/Workflows/.github/workflows/R-CMD-check-build.yml@main
with:
install-pksim: true
install-rClr: true
extra-packages: |
ospsuite.utils=github::Open-Systems-Pharmacology/OSPSuite.RUtils
tlf=github::Open-Systems-Pharmacology/TLF-Library
uses: ./.github/workflows/update-core-files.yaml

R-CMD-Check:
if: ${{ !cancelled() }}
needs: [update-core-files]
uses: ./.github/workflows/R-CMD-check.yaml

test-coverage:
if: ${{ always() }}
needs: [R-CMD-Check]
uses: Open-Systems-Pharmacology/Workflows/.github/workflows/test-pkg-and-coverage.yml@main
with:
install-pksim: true
install-rClr: true
extra-packages: |
ospsuite.utils=github::Open-Systems-Pharmacology/OSPSuite.RUtils
tlf=github::Open-Systems-Pharmacology/TLF-Library
if: ${{ !cancelled() }}
needs: [update-core-files]
uses: ./.github/workflows/test-coverage.yaml


pkgdown:
if: ${{ always() }}
needs: [R-CMD-Check]
uses: Open-Systems-Pharmacology/Workflows/.github/workflows/pkgdown.yml@main
with:
install-pksim: true
install-rClr: true
extra-packages: |
ospsuite.utils=github::Open-Systems-Pharmacology/OSPSuite.RUtils
tlf=github::Open-Systems-Pharmacology/TLF-Library
if: ${{ !cancelled() }}
needs: [update-core-files]
uses: ./.github/workflows/pkgdown.yaml
44 changes: 44 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 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:
workflow_call:

name: pkgdown

permissions: read-all

jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

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

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
clean: false
branch: gh-pages
folder: docs
58 changes: 58 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# 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:
workflow_call:

name: test-coverage

permissions: read-all

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4

- 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::xml2
needs: coverage

- name: Test coverage
run: |
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
covr::to_cobertura(cov)
shell: Rscript {0}

- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
file: ./cobertura.xml
plugin: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}

- 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@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
34 changes: 34 additions & 0 deletions .github/workflows/update-core-files.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on:
workflow_call:

name: R-CMD-check

permissions: write-all


jobs:
update-core-files:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- name: download-and-unzip-core-files
run: source("update_core_files.R")
shell: Rscript {0}

- uses: EndBug/add-and-commit@v9
if: ${{ success() }}
with:
message: '🤖 Update Core Files.'
default_author: github_actions
add: 'inst/lib'
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ vignettes/*.pdf

# Shiny token, see https://shiny.rstudio.com/articles/shinyapps.html
rsconnect/
doc

Meta

# Website output folder
docs
inst/doc
doc

# test artifacts
tests/testthat/*.pdf
13 changes: 7 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Package: ospsuite
Title: R package to manipulate OSPSuite Models
Version: 12.0.0.9002
Authors@R:
c(person("Open-Systems-Pharmacology Community", role = "cph"),
c(person("Open-Systems-Pharmacology Community", role = c("cph", "fnd")),
person("Michael", "Sevestre", role = c("aut", "cre"), email = "michael@design2code.ca"),
person("Pavel", "Balazki", role = "aut"),
person("Juri", "Solodenko", role = "aut", comment = c(ORCID = "0000-0001-6922-588X")),
Expand All @@ -19,8 +19,8 @@ URL: https://github.com/open-systems-pharmacology/ospsuite-r,
BugReports:
https://github.com/open-systems-pharmacology/ospsuite-r/issues
Depends:
R (>= 3.6),
rClr (>= 0.9.1),
R (>= 4.1),
rSharp
Imports:
dplyr (>= 1.0.0),
ospsuite.utils (>= 1.5.0),
Expand All @@ -47,7 +47,7 @@ Suggests:
Language: en-US
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Roxygen: list(markdown = TRUE)
VignetteBuilder: knitr
Config/testthat/edition: 3
Expand Down Expand Up @@ -141,5 +141,6 @@ Collate:
'zzz.R'
'zzz_deprecated.R'
Remotes:
Open-Systems-Pharmacology/OSPSuite.RUtils,
Open-Systems-Pharmacology/TLF-Library
Open-Systems-Pharmacology/rSharp,
ospsuite.utils=Open-Systems-Pharmacology/OSPSuite.RUtils,
tlf=Open-Systems-Pharmacology/TLF-Library
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export(validateDimension)
export(validateUnit)
import(data.table)
import(ospsuite.utils)
import(rClr)
import(rSharp)
import(tidyr)
import(tlf)
import(xml2)
Expand Down
8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- `{openxlsx}`
- `{lifecyle}`
- `{rSharp`}


## New features
Expand All @@ -21,13 +22,19 @@
- Added a function `exportSteadyStateToXLS()` to export steady state values
calculated for one simulation using the `getSteadyState()` to an Excel file
that can be imported in MoBi.

- The package does not require a local installation of PK-Sim any more. All required
dependencies are shipped with the package.

- The package fully supports Linux.

## Breaking Changes

- The single argument of the `getBaseUnit()` function is now named
`quantityOrDimension` (was `dimension` previously). It can now use objects
of class `Quantity` as inputs, to be consistent with the `toBaseUnit()`
function.
- The package gains a new dependency `{rSharp}`

## Major Changes

Expand All @@ -44,6 +51,7 @@
- `plotPopulationTimeProfile()` has a new `aggregation` argument that allow
the user to choose between quantiles, arithmetic and geometric aggregations
of y.
- The package loses dependency `{rClr}`


## Minor improvements and bug fixes
Expand Down
Loading

0 comments on commit b864fee

Please sign in to comment.