Skip to content

Commit ae50166

Browse files
committed
Add GitHub Actions CI for R CMD check
1 parent 61339c5 commit ae50166

File tree

12 files changed

+285
-119
lines changed

12 files changed

+285
-119
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
^src/.*\.c$
44
^src/.*\.so$
55

6+
^\.github$

.github/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html

.github/workflows/R-CMD-check.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
8+
name: R-CMD-check.yaml
9+
10+
permissions: read-all
11+
12+
jobs:
13+
R-CMD-check:
14+
runs-on: ${{ matrix.config.os }}
15+
16+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
config:
22+
- {os: macos-latest, r: 'release'}
23+
- {os: windows-latest, r: 'release'}
24+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
25+
- {os: ubuntu-latest, r: 'release'}
26+
- {os: ubuntu-latest, r: 'oldrel-1'}
27+
28+
env:
29+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
30+
R_KEEP_PKG_SOURCE: yes
31+
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- uses: r-lib/actions/setup-pandoc@v2
36+
37+
- uses: r-lib/actions/setup-r@v2
38+
with:
39+
r-version: ${{ matrix.config.r }}
40+
http-user-agent: ${{ matrix.config.http-user-agent }}
41+
use-public-rspm: true
42+
43+
- uses: r-lib/actions/setup-r-dependencies@v2
44+
with:
45+
extra-packages: any::rcmdcheck
46+
needs: check
47+
48+
- uses: r-lib/actions/check-r-package@v2
49+
with:
50+
upload-snapshots: true
51+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
52+
error-on: '"error"'

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ Imports:
3535
abind,
3636
einsum,
3737
optimx
38+
Remotes:
39+
simonbeyer1/CppODE@v1.0.0
3840
Suggests:
3941
MASS,
40-
rPython,
4142
pander,
4243
knitr,
4344
rmarkdown,

README.Rmd

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,53 @@ output:
33
html_document:
44
keep_md: yes
55
---
6-
# dMod -- Dynamic Modeling and Parameter Estimation in R
6+
# dMod - Dynamic Modeling and Parameter Estimation in R
7+
8+
<!-- badges: start -->
9+
10+
[![R-CMD-check](https://github.com/JetiLab/dMod/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/JetiLab/dMod/actions/workflows/R-CMD-check.yaml)
11+
12+
<!-- badges: end -->
713

814
The dMod package is a framework that provides functions to generate ODEs of reaction networks, parameter transformations, observation functions, residual functions, etc. The framework follows the paradigm that derivative information should be used for optimization whenever possible. Therefore, all major functions produce and can handle expressions for symbolic derivatives.
915

1016
## System requirements
1117

12-
dMod uses the package [cOde](https://github.com/dkaschek/cOde) to set up ODE models as compiled C code (deSolve) or C++ code (Sundials). This means that **C and C++ compilers** are required on the system. On Linux, the compilers are installed by default. Windows users need to install [RTools](https://cran.r-project.org/bin/windows/Rtools/).
18+
dMod uses the package [cOde](https://github.com/dkaschek/cOde) to set up ODE models as compiled C code (deSolve) or [CppODE](https://github.com/simonbeyer1/CppODE) to autogenerate C++ code (Boost.Odeint). This means that **C and C++ compilers** are required on the system. On Linux, the compilers are installed by default. Windows users need to install [RTools](https://cran.r-project.org/bin/windows/Rtools/).
19+
20+
For **parallelization**, dMod uses `mclapply()` on Linux and macOS. On Windows, parallelization is implemented via the `foreach` package using `%dopar%`.
21+
22+
## Installation from GitHub
23+
24+
To **install dMod from the GitHub repository**, it is convenient to use **RStudio**.
25+
26+
1. Create a new project via\
27+
**File → New Project → Version Control → Git**.
28+
29+
2. Use the repository URL\
30+
31+
```
32+
33+
[https://github.com/jetilab/dMod](https://github.com/jetilab/dMod)
34+
```
35+
36+
and create the project.
37+
38+
3. Install all required package dependencies (including GitHub dependencies specified via `Remotes`) by running:
39+
40+
``` r
41+
remotes::install_deps(dependencies = TRUE)
42+
```
43+
44+
4. Open the **Build** tab in RStudio and click **Build and Reload** (or **Install**).
1345

14-
For **parallelization**, dMod uses `mclapply()` on Linux and Mac. For Windows, parallelization is implemented via the `foreach` package using `%dopar%`.
46+
Once these steps are completed, it should be possible to run the following example.
1547

16-
To **install dMod from the git repository**, it is convenient to use RStudio. Create a "New Project" -> "Version Control" -> "Git". Use the address `https://github.com/dkaschek/dMod` and create project. Next, go to menu "Build" -> "Build and Reload". Once theses steps are completed, it should be possible to run the following example.
48+
------------------------------------------------------------------------
1749

18-
When installing dMod from github, you use the development version of dMod. Further packages might be needed to install. In particular, please make sure that if you install dMod from github, also [cOde](https://github.com/dkaschek/cOde) is installed from github.
50+
If **PEtab support** is required, **libSBML** is needed in addition. Installation and usage instructions can be found in the wiki under [Support for PEtab](https://github.com/dkaschek/dMod/wiki/Support-for-PEtab).
1951

20-
If **PEtab support** is wanted, libSBML will be required in addition. Installation and usage instructions can be found in the wiki under [Support for PEtab](https://github.com/dkaschek/dMod/wiki/Support-for-PEtab)
52+
------------------------------------------------------------------------
2153

2254

2355

@@ -177,7 +209,7 @@ plotProfile(profiles)
177209
# Cleaning step
178210
dlls <- list.files(pattern = "\\.(so|dll)$")
179211
for (d in dlls) try(dyn.unload(d), silent = TRUE)
180-
files <- list.files(pattern = "^(enzymeKinetics|obsfn).*(c|o|dll|so)$")
212+
files <- list.files(pattern = "^(enzymeKinetics|obsfn|expl_parfn_noDegradation|expl_parfn_withDegradation).*(c|cpp|o|dll|so)$")
181213
unlink(files)
182214
183215
```

README.html

Lines changed: 141 additions & 107 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,57 @@
1+
---
2+
output:
3+
html_document:
4+
keep_md: yes
5+
---
16
# dMod - Dynamic Modeling and Parameter Estimation in R
27

8+
<!-- badges: start -->
9+
10+
[![R-CMD-check](https://github.com/JetiLab/dMod/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/JetiLab/dMod/actions/workflows/R-CMD-check.yaml)
11+
12+
<!-- badges: end -->
13+
314
The dMod package is a framework that provides functions to generate ODEs of reaction networks, parameter transformations, observation functions, residual functions, etc. The framework follows the paradigm that derivative information should be used for optimization whenever possible. Therefore, all major functions produce and can handle expressions for symbolic derivatives.
415

516
## System requirements
617

718
dMod uses the package [cOde](https://github.com/dkaschek/cOde) to set up ODE models as compiled C code (deSolve) or [CppODE](https://github.com/simonbeyer1/CppODE) to autogenerate C++ code (Boost.Odeint). This means that **C and C++ compilers** are required on the system. On Linux, the compilers are installed by default. Windows users need to install [RTools](https://cran.r-project.org/bin/windows/Rtools/).
819

9-
For **parallelization**, dMod uses `mclapply()` on Linux and Mac. For Windows, parallelization is implemented via the `foreach` package using `%dopar%`.
20+
For **parallelization**, dMod uses `mclapply()` on Linux and macOS. On Windows, parallelization is implemented via the `foreach` package using `%dopar%`.
21+
22+
## Installation from GitHub
23+
24+
To **install dMod from the GitHub repository**, it is convenient to use **RStudio**.
25+
26+
1. Create a new project via\
27+
**File → New Project → Version Control → Git**.
28+
29+
2. Use the repository URL\
1030

11-
To **install dMod from the git repository**, it is convenient to use RStudio. Create a "New Project" -\> "Version Control" -\> "Git". Use the address `https://github.com/dkaschek/dMod` and create project. Next, go to menu "Build" -\> "Build and Reload". Once theses steps are completed, it should be possible to run the following example.
31+
```
32+
33+
[https://github.com/jetilab/dMod](https://github.com/jetilab/dMod)
34+
```
35+
36+
and create the project.
37+
38+
3. Install all required package dependencies (including GitHub dependencies specified via `Remotes`) by running:
39+
40+
``` r
41+
remotes::install_deps(dependencies = TRUE)
42+
```
43+
44+
4. Open the **Build** tab in RStudio and click **Build and Reload** (or **Install**).
45+
46+
Once these steps are completed, it should be possible to run the following example.
47+
48+
------------------------------------------------------------------------
49+
50+
If **PEtab support** is required, **libSBML** is needed in addition. Installation and usage instructions can be found in the wiki under [Support for PEtab](https://github.com/dkaschek/dMod/wiki/Support-for-PEtab).
51+
52+
------------------------------------------------------------------------
1253

13-
When installing dMod from github, you use the development version of dMod. Further packages might be needed to install. In particular, please make sure that if you install dMod from github, also [cOde](https://github.com/dkaschek/cOde) and [CppODE](https://github.com/simonbeyer1/CppODE) are installed from github.
1454

15-
If **PEtab support** is wanted, libSBML will be required in addition. Installation and usage instructions can be found in the wiki under [Support for PEtab](https://github.com/dkaschek/dMod/wiki/Support-for-PEtab)
1655

1756
## Simple example: enzyme kinetics
1857

@@ -155,6 +194,7 @@ plot((g*x*p)(times, myfit$argument), data)
155194

156195
![](README_files/figure-html/trust-1.png)<!-- -->
157196

197+
158198
### Compute the profile likelihood to analyze parameter identifiability
159199

160200
``` r
@@ -167,3 +207,8 @@ plotProfile(profiles)
167207
```
168208

169209
![](README_files/figure-html/profiles-1.png)<!-- -->
210+
211+
212+
213+
214+
30.6 KB
Loading
27.5 KB
Loading
28.8 KB
Loading

0 commit comments

Comments
 (0)