Skip to content

Commit 1e86e6d

Browse files
committed
Add github actions + rename package biomech + add description + add readme
1 parent 511253d commit 1e86e6d

23 files changed

+372
-148
lines changed

Diff for: .Rbuildignore

+1
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ man/figures
1111
^codecov\.yml$
1212
^bin$
1313
^tmp$
14+
^\.github$

Diff for: .github/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html

Diff for: .github/workflows/R-CMD-check.yaml

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
2+
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
name: R-CMD-check
12+
13+
jobs:
14+
R-CMD-check:
15+
runs-on: ${{ matrix.config.os }}
16+
17+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
config:
23+
- {os: windows-latest, r: 'release'}
24+
- {os: macOS-latest, r: 'release'}
25+
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
26+
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
27+
28+
env:
29+
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
30+
RSPM: ${{ matrix.config.rspm }}
31+
32+
steps:
33+
- uses: actions/checkout@v2
34+
35+
- uses: r-lib/actions/setup-r@master
36+
with:
37+
r-version: ${{ matrix.config.r }}
38+
39+
- uses: r-lib/actions/setup-pandoc@master
40+
41+
- name: Query dependencies
42+
run: |
43+
install.packages('remotes')
44+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
45+
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
46+
shell: Rscript {0}
47+
48+
- name: Cache R packages
49+
if: runner.os != 'Windows'
50+
uses: actions/cache@v1
51+
with:
52+
path: ${{ env.R_LIBS_USER }}
53+
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
54+
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
55+
56+
- name: Install system dependencies
57+
if: runner.os == 'Linux'
58+
run: |
59+
while read -r cmd
60+
do
61+
eval sudo $cmd
62+
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
63+
64+
- name: Install dependencies
65+
run: |
66+
remotes::install_deps(dependencies = TRUE)
67+
remotes::install_cran("rcmdcheck")
68+
shell: Rscript {0}
69+
70+
- name: Check
71+
env:
72+
_R_CHECK_CRAN_INCOMING_REMOTE_: false
73+
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
74+
shell: Rscript {0}
75+
76+
- name: Upload check results
77+
if: failure()
78+
uses: actions/upload-artifact@main
79+
with:
80+
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
81+
path: check

Diff for: .github/workflows/pkgdown.yaml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
on:
2+
push:
3+
branches: master
4+
5+
name: pkgdown
6+
7+
jobs:
8+
pkgdown:
9+
runs-on: macOS-latest
10+
env:
11+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- uses: r-lib/actions/setup-r@master
16+
17+
- uses: r-lib/actions/setup-pandoc@master
18+
19+
- name: Query dependencies
20+
run: |
21+
install.packages('remotes')
22+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
23+
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
24+
shell: Rscript {0}
25+
26+
- name: Cache R packages
27+
uses: actions/cache@v1
28+
with:
29+
path: ${{ env.R_LIBS_USER }}
30+
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
31+
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
32+
33+
- name: Install dependencies
34+
run: |
35+
remotes::install_deps(dependencies = TRUE)
36+
install.packages("pkgdown")
37+
shell: Rscript {0}
38+
39+
- name: Install package
40+
run: R CMD INSTALL .
41+
42+
- name: Deploy package
43+
run: |
44+
git config --local user.email "[email protected]"
45+
git config --local user.name "GitHub Actions"
46+
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'

Diff for: .github/workflows/render-readme.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
on:
2+
push:
3+
paths:
4+
- README.Rmd
5+
6+
name: Render README
7+
8+
jobs:
9+
render:
10+
name: Render README
11+
runs-on: macOS-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: r-lib/actions/setup-r@v1
15+
- uses: r-lib/actions/setup-pandoc@v1
16+
- name: Install rmarkdown, remotes, and the local package
17+
run: |
18+
install.packages("remotes")
19+
remotes::install_local(".")
20+
remotes::install_cran("rmarkdown")
21+
shell: Rscript {0}
22+
- name: Render README
23+
run: Rscript -e 'rmarkdown::render("README.Rmd")'
24+
- name: Commit results
25+
run: |
26+
git config --local user.email "[email protected]"
27+
git config --local user.name "GitHub Actions"
28+
git commit README.md -m 'Re-build README.Rmd' || echo "No changes to commit"
29+
git push origin || echo "No changes to commit"

Diff for: DESCRIPTION

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
Package: deformation
1+
Package: biomech
22
Type: Package
3-
Title: What the Package Does (Title Case)
3+
Title: Compute Beam Bending and Torsion
44
Version: 0.1.0
5-
Author: Who wrote it
6-
Maintainer: The package maintainer <[email protected]>
7-
Description: More about what it does (maybe more than one line)
8-
Use four spaces when indenting paragraphs within the Description.
9-
License: What license is it under?
5+
Authors@R: c(person(given = "Remi", family = "Vezy", email = "[email protected]", role = c("aut","cre"),comment = c(ORCID = "0000-0002-0808-1461")),
6+
person(given = "Loic", family = "Brancheriau", email = "[email protected]", role = c("aut")),
7+
person(given = "Raphael", family = "Perez", email = "[email protected]", role = c("aut")),
8+
person(given = "Jean", family = "Dauzat", email = "[email protected]", role = c("aut")))
9+
Description: Compute bending and torsion of beams following the Euler-Bernoulli beam theory. It is specifically designed to be applied on
10+
tree branches (or e.g. palm leaves), but is available for any other beam-shaped structure.
11+
License: GPL-3
1012
Encoding: UTF-8
1113
LazyData: true
1214
Roxygen: list(markdown = TRUE)
1315
RoxygenNote: 7.1.1
1416
Suggests:
1517
testthat
1618
Config/testthat/edition: 3
19+
Imports:
20+
data.table

Diff for: R/Agl_Vers_XYZ.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#' @param vAngle_XY Angle between the segment and the XY plane (radian)
77
#' @param vAngle_XZ Angle between the segment and the XZ plane (radian)
88
#'
9-
#' @return
9+
#' @return Point coordinates
1010
#' @export
1111
#'
1212
Agl_Vers_XYZ = function(dist_P2P1, vAngle_XY, vAngle_XZ){

Diff for: R/InterpPoints.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ InterpPoints = function(matPoints, pas){
2121
vAngle_XZ = XYZ_Agl$vAngle_XZ
2222

2323
distLineique = cumsum(vDist_P2P1)
24-
distTotale = tail(distLineique,1)
24+
distTotale = utils::tail(distLineique,1)
2525

2626
# Les distances des segments ne peuvent pas etre nulles
2727
# Le point origine (0,0,0) ne peut etre dans matPoints

Diff for: R/XYZ_Vers_Agl.R

+2-3
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@
1212
#' @export
1313
#'
1414
#' @examples
15-
#' library(data.table)
16-
#' filepath = system.file("extdata/6_EW01.22_17_kanan.txt", package = "deformation")
15+
#' filepath = system.file("extdata/6_EW01.22_17_kanan.txt", package = "biomech")
1716
#' df = read_mat(filepath)
1817
#' df = unbend(2000,400,df)
19-
#' XYZ_Vers_Agl(df[1,],df[2,],df[3,])
18+
#' XYZ_Vers_Agl(df$x,df$y,df$z)
2019
#'
2120
XYZ_Vers_Agl = function(vecX, vecY, vecZ){
2221
N = length(vecX)

0 commit comments

Comments
 (0)