Skip to content

Commit 46c4f28

Browse files
Merge pull request #60 from HighlanderLab/issue/58
Adding document GitHub action
2 parents 67a3a8e + f6b565b commit 46c4f28

43 files changed

Lines changed: 1825 additions & 888 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/.gitignore

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

.github/workflows/document.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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+
paths: ["R/**"]
6+
7+
name: document.yaml
8+
9+
permissions: read-all
10+
11+
jobs:
12+
document:
13+
runs-on: ubuntu-latest
14+
env:
15+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
16+
permissions:
17+
contents: write
18+
steps:
19+
- name: Checkout repo
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Setup R
25+
uses: r-lib/actions/setup-r@v2
26+
with:
27+
use-public-rspm: true
28+
29+
- name: Install dependencies
30+
uses: r-lib/actions/setup-r-dependencies@v2
31+
with:
32+
working-directory: RcppTskit
33+
extra-packages: any::roxygen2
34+
needs: roxygen2
35+
36+
- name: Document
37+
run: setwd("RcppTskit"); roxygen2::roxygenise()
38+
shell: Rscript {0}
39+
40+
- name: Commit and push changes
41+
run: |
42+
git config --local user.name "$GITHUB_ACTOR"
43+
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
44+
git add man/\* NAMESPACE DESCRIPTION
45+
git commit -m "Update documentation" || echo "No changes to commit"
46+
git pull --ff-only
47+
git push origin

.github/workflows/r-universe-check.yaml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.gitignore

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
1-
*.Rproj
1+
.DS_Store
22
.Rproj.user
33
.Rhistory
44
.RData
55
.Ruserdata
66
.vscode
7+
*.Rproj
8+
RcppTskit/cran-comments.html
9+
RcppTskit/cran-comments_files/
10+
RcppTskit/**/.quarto/
11+
RcppTskit/inst/doc
712
RcppTskit/src/*.o
813
RcppTskit/src/tskit/*.o
914
RcppTskit/src/*.so
1015
RcppTskit/src/*.dll*
1116
RcppTskit/src/Makevars
1217
RcppTskit/src/Makevars.win
18+
RcppTskit/vignettes/*.html
19+
RcppTskit/vignettes/*.R
20+
RcppTskit/vignettes/*_files/
21+
README.html
22+
README_files/
1323
test.trees
14-
.DS_Store
15-
*.html

CODE_OF_CONDUCT.md

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, caste, color, religion, or sexual
10+
identity and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the overall
26+
community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or advances of
31+
any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email address,
35+
without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at gregor.gorjanc@gmail.com.
63+
All complaints will be reviewed and investigated promptly and fairly.
64+
65+
All community leaders are obligated to respect the privacy and security of the
66+
reporter of any incident.
67+
68+
## Enforcement Guidelines
69+
70+
Community leaders will follow these Community Impact Guidelines in determining
71+
the consequences for any action they deem in violation of this Code of Conduct:
72+
73+
### 1. Correction
74+
75+
**Community Impact**: Use of inappropriate language or other behavior deemed
76+
unprofessional or unwelcome in the community.
77+
78+
**Consequence**: A private, written warning from community leaders, providing
79+
clarity around the nature of the violation and an explanation of why the
80+
behavior was inappropriate. A public apology may be requested.
81+
82+
### 2. Warning
83+
84+
**Community Impact**: A violation through a single incident or series of
85+
actions.
86+
87+
**Consequence**: A warning with consequences for continued behavior. No
88+
interaction with the people involved, including unsolicited interaction with
89+
those enforcing the Code of Conduct, for a specified period of time. This
90+
includes avoiding interactions in community spaces as well as external channels
91+
like social media. Violating these terms may lead to a temporary or permanent
92+
ban.
93+
94+
### 3. Temporary Ban
95+
96+
**Community Impact**: A serious violation of community standards, including
97+
sustained inappropriate behavior.
98+
99+
**Consequence**: A temporary ban from any sort of interaction or public
100+
communication with the community for a specified period of time. No public or
101+
private interaction with the people involved, including unsolicited interaction
102+
with those enforcing the Code of Conduct, is allowed during this period.
103+
Violating these terms may lead to a permanent ban.
104+
105+
### 4. Permanent Ban
106+
107+
**Community Impact**: Demonstrating a pattern of violation of community
108+
standards, including sustained inappropriate behavior, harassment of an
109+
individual, or aggression toward or disparagement of classes of individuals.
110+
111+
**Consequence**: A permanent ban from any sort of public interaction within the
112+
community.
113+
114+
## Attribution
115+
116+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
117+
version 2.1, available at
118+
<https://www.contributor-covenant.org/version/2/1/code_of_conduct.html>.
119+
120+
Community Impact Guidelines were inspired by
121+
[Mozilla's code of conduct enforcement ladder][https://github.com/mozilla/inclusion].
122+
123+
For answers to common questions about this code of conduct, see the FAQ at
124+
<https://www.contributor-covenant.org/faq>. Translations are available at <https://www.contributor-covenant.org/translations>.
125+
126+
[homepage]: https://www.contributor-covenant.org

README.md

Lines changed: 52 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,57 @@
22

33
## Overview
44

5-
Tskit enables performant storage, manipulation, and analysis of ancestral
5+
`Tskit` enables performant storage, manipulation, and analysis of ancestral
66
recombination graphs (ARGs) using succinct tree sequence encoding.
7+
The tree sequence encoding of an ARG is
8+
described in Wong et al. (2024) <doi:10.1093/genetics/iyae100>.
79
See https://tskit.dev for project news, documentation, and tutorials.
8-
Tskit provides Python, C, and Rust APIs. The Python API can be called from R
9-
via the `reticulate` R package to seamlessly load and analyse a tree sequence,
10-
as described at https://tskit.dev/tutorials/RcppTskit.html.
10+
`Tskit` provides Python, C, and Rust application programming interfaces (APIs).
11+
The Python API can be called from R via the `reticulate` R package to
12+
seamlessly load and analyse a tree sequence, as described at
13+
https://tskit.dev/tutorials/RcppTskit.html.
1114
`RcppTskit` provides R access to the `tskit` C API for use cases where the
12-
`reticulate` approach is not optimal. For example, for high-performance and
13-
low-level work with tree sequences. Currently, `RcppTskit` provides a very limited
15+
`reticulate` option is not optimal. For example, for high-performance and
16+
low-level work with tree sequences. Currently, `RcppTskit` provides a limited
1417
number of R functions due to the availability of extensive Python API and
15-
the `reticulate` approach.
18+
the `reticulate` option.
1619

17-
See more details on the state of the tree sequence ecosystem and aims for
18-
`RcppTskit` in [RcppTskit/inst/STATE_and_AIMS.md](RcppTskit/inst/STATE_and_AIMS.md),
19-
including examples on how to use it on its own or to develop new R packages.
20-
21-
TODO: Think how to best point to use cases. Probably best to point to vignette and pkgdown!?
22-
https://github.com/HighlanderLab/RcppTskit/issues/10
20+
See more details on the state of the tree sequence ecosystem and aims of
21+
`RcppTskit` in [the introduction vignette](https://highlanderlab.r-universe.dev/articles/RcppTskit/RcppTskit_intro.html) ([source](RcppTskit/vignettes/RcppTskit_intro.qmd)).
22+
The vignette also shows examples on how to use `RcppTskit` on its own or
23+
to develop new R packages.
2324

2425
## Status
2526

2627
<!-- badges: start -->
2728

28-
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) <!-- Row 1, Col 1 --> [![Development](https://img.shields.io/badge/development-active-blue.svg)](https://img.shields.io/badge/development-active-blue.svg) <!-- Row 1, Col 2 --> [![Licence](https://img.shields.io/badge/licence-MIT-blue.svg)](https://opensource.org/licenses/MIT) <!-- Row 1, Col 3 -->
29+
<!-- Row 1 -->
30+
General: [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) <!-- Col-1-End -->
31+
[![Development](https://img.shields.io/badge/development-active-blue.svg)](https://img.shields.io/badge/development-active-blue.svg) <!-- Col-2-End -->
32+
[![Licence](https://img.shields.io/badge/licence-MIT-blue.svg)](https://opensource.org/licenses/MIT) <!-- Col-3-End -->
33+
34+
<!-- Row 2 -->
35+
Release: [![CRAN version](https://www.r-pkg.org/badges/version/RcppTskit)](https://CRAN.R-project.org/package=RcppTskit) <!-- Col-1-End -->
36+
[![Downloads - total](https://cranlogs.r-pkg.org/badges/grand-total/RcppTskit)](https://cranlogs.r-pkg.org/badges/grand-total/RcppTskit) <!-- Col-2-End -->
37+
![GitHub version (main)](https://img.shields.io/github/r-package/v/HighlanderLab/RcppTskit/main?filename=RcppTskit%2FDESCRIPTION&label=Github) <!-- Col-3-End -->
2938

30-
<!-- line break 1 -->
31-
[![CRAN version](https://www.r-pkg.org/badges/version/RcppTskit)](https://CRAN.R-project.org/package=RcppTskit) <!-- Row 2, Col 1 --> ![GitHub version (main)](https://img.shields.io/github/r-package/v/HighlanderLab/RcppTskit/main?filename=RcppTskit%2FDESCRIPTION&label=Github) <!-- Row 2, Col 2 --> [![Downloads - total](https://cranlogs.r-pkg.org/badges/grand-total/RcppTskit)](https://cranlogs.r-pkg.org/badges/grand-total/RcppTskit) <!-- Row 2, Col 3 -->
39+
<!-- Row 3 -->
40+
R CMD checks: [![CRAN](https://cranchecks.info/badges/summary/RcppTskit?label=CRAN)](https://cran.r-project.org/web/checks/check_results_RcppTskit.html) <!-- Col-1-End -->
41+
[![R universe](https://highlanderlab.r-universe.dev/RcppTskit/badges/checks?label=R-universe)](https://highlanderlab.r-universe.dev/RcppTskit) <!-- Col-2-End -->
42+
[![GitHub](https://img.shields.io/github/actions/workflow/status/HighlanderLab/RcppTskit/R-CMD-check.yaml?label=GitHub)](https://github.com/HighlanderLab/RcppTskit/actions/workflows/R-CMD-check.yaml) <!-- Col-3-End -->
3243

33-
<!-- line break 2 -->
34-
[![CRAN R CMD check](https://cranchecks.info/badges/summary/RcppTskit)](https://cran.r-project.org/web/checks/check_results_RcppTskit.html) <!-- Row 3, Col 1 --> ![GitHub R CMD check](https://img.shields.io/github/actions/workflow/status/HighlanderLab/RcppTskit/R-CMD-check.yaml?label=GitHub%20R%20CMD%20check) <!-- Row 3, Col 2 --> [![Codecov test coverage](https://codecov.io/gh/HighlanderLab/RcppTskit/graph/badge.svg)](https://app.codecov.io/gh/HighlanderLab/RcppTskit) <!-- Row 3, Col 3 -->
44+
<!-- Row 4 -->
45+
Code quality: [![Codecov test coverage](https://codecov.io/gh/HighlanderLab/RcppTskit/graph/badge.svg)](https://app.codecov.io/gh/HighlanderLab/RcppTskit) <!-- Col-1-End -->
3546

3647
<!-- badges: end -->
3748

3849
## Contents
3950

40-
* `extern` - Git submodule for `tskit` and instructions on obtaining the latest version and copying the `tskit` C code into `RcppTskit` directory. `extern` is saved outside of the `RcppTskit` directory because `R CMD CHECK` complains otherwise.
51+
* `extern` - Git submodule for `tskit` and instructions on
52+
obtaining the latest version and copying the `tskit` C code into
53+
`RcppTskit` directory.
54+
`extern` is saved outside of the `RcppTskit` directory
55+
because `R CMD CHECK` complains otherwise (even with `.Rbuildignore`).
4156

4257
* `RcppTskit` - R package `RcppTskit`.
4358

@@ -67,33 +82,39 @@ https://mac.r-project.org/tools for macOS tools.
6782
```
6883
# install.packages("remotes") # If you don't have it already
6984
70-
# Release (TODO)
85+
# Release
7186
# TODO: Tag a release #15
7287
# https://github.com/HighlanderLab/RcppTskit/issues/15
7388
# remotes::install_github("HighlanderLab/RcppTskit/RcppTskit")
7489
7590
# Main branch
76-
remotes::install_github("HighlanderLab/RcppTskit/RcppTskit")
91+
remotes::install_github("HighlanderLab/RcppTskit/RcppTskit@main")
7792
7893
# Development branch
79-
# TODO: Create a devel branch #16
80-
# https://github.com/HighlanderLab/RcppTskit/issues/16
81-
# remotes::install_github("HighlanderLab/RcppTskit/RcppTskit@devel")
94+
remotes::install_github("HighlanderLab/RcppTskit/RcppTskit@devel")
8295
```
8396

8497
## Development
8598

99+
### Code of Conduct
100+
101+
Please note that the `RcppTskit` project is released with a
102+
[Contributor Code of Conduct](https://contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html).
103+
By contributing to this project, you agree to abide by its terms.
104+
86105
### Clone
87106

88-
First clone the repository:
107+
First clone the repository and step into the directory:
89108

90109
```
91110
git clone https://github.com/HighlanderLab/RcppTskit.git
111+
cd RcppTskit
92112
```
93113

94114
### Pre-commit install
95115

96-
We use [pre-commit](https://pre-commit.com) hooks to ensure code quality. Specifically, we use:
116+
We use [pre-commit](https://pre-commit.com) hooks to ensure code quality.
117+
Specifically, we use:
97118
* [air](https://github.com/posit-dev/air) to format R code,
98119
* [jarl](https://github.com/etiennebacher/jarl) to lint R code,
99120
* [clang-format](https://clang.llvm.org/docs/ClangFormat.html) to format C/C++ code, and
@@ -111,7 +132,8 @@ If you plan to update `tskit`, follow instructions in `extern/README.md`.
111132

112133
### RcppTskit
113134

114-
Then open `RcppTskit` package directory in your favourite R IDE (Positron, RStudio, text-editor-of-your-choice, etc.) and implement your changes.
135+
Then open `RcppTskit` package directory in your favourite R IDE
136+
(Positron, RStudio, text-editor-of-your-choice, etc.) and implement your changes.
115137

116138
You should routinely check your changes (in R):
117139

@@ -161,6 +183,8 @@ pre-commit run --all-files
161183

162184
### Continuous integration
163185

164-
We use Github Actions to run continuous integration (CI) checks on each push and pull request. Specifically, we run:
186+
We use Github Actions to run continuous integration (CI) checks
187+
on each push and pull request.
188+
Specifically, we run:
165189
* [R CMD check](.github/workflows/R-CMD-check.yaml) on multiple platforms and
166190
* [covr test coverage](.github/workflows/covr.yaml).

RcppTskit/.Rbuildignore

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,19 @@
99
^\.clang-format$
1010
^\.covrignore$
1111
^\.github$
12-
^pkg_dev_notes\.md$
1312
^codecov\.yaml$
14-
^notes_pkg_dev\.Rmd$
13+
^cran-comments\.md$
14+
^cran-comments\.html$
15+
^cran-comments_files$
1516
^inst/examples/create_test\.trees\.R$
1617
^inst/examples/create_test\.trees\.py$
18+
^inst/examples/explore_reticulate\.R$
19+
^inst/examples/explore_slendr\.R$
20+
^LICENSE.md$
21+
^notes_pkg_dev\.Rmd$
22+
^pkg_dev_notes\.md$
23+
^tests/testthat/_snaps$
24+
^tools/clang-tidy\.py$
25+
^vignettes/\.quarto$
26+
^vignettes/*_files$
27+
^\.\.$

0 commit comments

Comments
 (0)