Skip to content

Commit 0b7f69b

Browse files
committed
Fixing vignette not found
1 parent 58860b5 commit 0b7f69b

6 files changed

Lines changed: 52 additions & 13 deletions

File tree

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ repos:
2828
hooks:
2929
- id: air-format
3030
name: air format
31-
entry: air format .
31+
entry: RcppTskit/tools/run-local-tool.sh air format .
3232
language: system
3333
pass_filenames: false
3434
files: '\.(R|Rmd|rmd|qmd|Qmd)$'
3535

3636
- id: jarl-lint
3737
name: jarl lint
38-
entry: jarl check .
38+
entry: RcppTskit/tools/run-local-tool.sh jarl check .
3939
language: system
4040
pass_filenames: false
4141
files: '\.(R|Rmd|rmd|qmd|Qmd)$'

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ To install the published release from [CRAN](https://cran.r-project.org) use:
7373
# https://github.com/HighlanderLab/RcppTskit/issues/14
7474
# https://github.com/HighlanderLab/RcppTskit/issues/45
7575
# install.packages("RcppTskit")
76+
# vignette("RcppTskit_intro")
7677
```
7778

7879
To install the latest development version (possibly unstable!) from
@@ -99,10 +100,14 @@ https://mac.r-project.org/tools for macOS tools.
99100
# remotes::install_github("HighlanderLab/RcppTskit/RcppTskit")
100101
101102
# Main branch
102-
remotes::install_github("HighlanderLab/RcppTskit/RcppTskit@main")
103+
remotes::install_github("HighlanderLab/RcppTskit/RcppTskit@main",
104+
build_vignettes=TRUE)
103105
104106
# Development branch
105-
remotes::install_github("HighlanderLab/RcppTskit/RcppTskit@devel")
107+
remotes::install_github("HighlanderLab/RcppTskit/RcppTskit@devel",
108+
build_vignettes=TRUE)
109+
110+
vignette("RcppTskit_intro")
106111
```
107112

108113
## Development

RcppTskit/R/RcppTskit-package.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#' @importFrom reticulate import is_py_object py_module_available py_require
2525
#'
2626
#' @examples
27-
#' vignette(package="RcppTskit")
27+
#' vignette("RcppTskit_intro")
2828
"_PACKAGE"
2929

3030
#' Provide an inline plugin so we can call the tskit C API with functions like

RcppTskit/man/RcppTskit-package.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

RcppTskit/tools/run-local-tool.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env sh
2+
set -eu
3+
4+
if [ "$#" -lt 1 ]; then
5+
echo "Usage: $0 <tool> [args...]" >&2
6+
exit 2
7+
fi
8+
9+
tool="$1"
10+
shift
11+
12+
if command -v "$tool" >/dev/null 2>&1; then
13+
exec "$tool" "$@"
14+
fi
15+
16+
# Follow project guidance by checking user-local bin directories.
17+
if [ -n "${HOME:-}" ]; then
18+
PATH="${HOME}/.local/bin:${HOME}/bin:${PATH}"
19+
export PATH
20+
if command -v "$tool" >/dev/null 2>&1; then
21+
exec "$tool" "$@"
22+
fi
23+
fi
24+
25+
# As a last resort, query the user's login shell PATH.
26+
if [ -n "${SHELL:-}" ] && [ -x "${SHELL:-}" ]; then
27+
resolved="$("${SHELL}" -lc "command -v \"$tool\"" 2>/dev/null || true)"
28+
if [ -n "$resolved" ] && [ -x "$resolved" ]; then
29+
exec "$resolved" "$@"
30+
fi
31+
fi
32+
33+
echo "Executable '$tool' not found on PATH." >&2
34+
echo "Install '$tool' and ensure your shell PATH exports it." >&2
35+
exit 3

RcppTskit/vignettes/RcppTskit_intro.qmd

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,21 +141,20 @@ to record a tree sequence in a multi-generation simulation with many individuals
141141

142142
Given the current tree sequence ecosystem,
143143
the aims of the `RcppTskit` package are to provide an easy-to-install R package
144-
that supports users in four typical cases.
144+
that supports users in four typical cases of working with tree sequences
145+
and table collection.
145146
The authors are open to expanding this scope of `RcppTskit`
146147
depending on user demand and engagement.
147148
The four typical cases are:
148149

149-
1. Load a tree sequence[^ts_and_tc_note] into R and summarise it,
150+
1. Load a tree sequence into R and summarise it,
150151

151-
2. Pass a tree sequence[^ts_and_tc_note] between R and reticulate or standard Python,
152+
2. Pass a tree sequence between R and reticulate or standard Python,
152153

153154
3. Call the `tskit` C API from C++ in an R session or script, and
154155

155156
4. Call the `tskit` C API from C++ in another R package.
156157

157-
[^ts_and_tc_note]: Both tree sequence and table collection types are supported.
158-
159158
Examples for all of these cases are provided below
160159
after we describe the implemented data and class model.
161160

@@ -213,7 +212,7 @@ if (!test) {
213212
}
214213
```
215214

216-
### 1) Load a tree sequence[^ts_and_tc_note] into R and summarise it
215+
### 1) Load a tree sequence into R and summarise it
217216

218217
```{r}
219218
#| label: use_case_1
@@ -239,7 +238,7 @@ ts2 <- tc$tree_sequence()
239238
help(package = "RcppTskit")
240239
```
241240

242-
### 2) Pass a tree sequence[^ts_and_tc_note] between R and reticulate or standard Python
241+
### 2) Pass a tree sequence between R and reticulate or standard Python
243242

244243
```{r}
245244
#| label: use_case_2

0 commit comments

Comments
 (0)