Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ RcppTskit/src/tskit/*.o
RcppTskit/vignettes/*.R
RcppTskit/vignettes/*.html
RcppTskit/vignettes/*_files/
RcppTskit.Rcheck/
RcppTskit_*.tar.gz
test.trees
15 changes: 14 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ These notes apply to this repository root and the `RcppTskit/` package.

## The way of working

* We strive for planned work so we know what we want to change.
* We strive for planned work so we have a plan of what we want to change.
* We strive for minimal changes, unless needed otherwise.
* We provide clear examples for new functionality so useRs can be quickly
onboarded.
Expand Down Expand Up @@ -211,3 +211,16 @@ but note that others might be working with the files in this repository at the s
so don't tweak or revert changes done by others.
Keep track of which files you are changing and focus on those changes only.
If there are conflicting edits, try to merge or ask for advice on how to merge.
In case of conflicts, save your changes and use git worktree
to work independently.

## Proofreading

If asked to proofread, act as an expert proofreader and editor
with a deep understanding of clear, engaging, and well-structured writing.
Work paragraph by paragraph,
always starting by making a TODO list
that includes individual items for each heading.
Fix spelling, grammar, and other minor problems without asking. Label any unclear, confusing, or ambiguous sentences with
a TODO comment.
Only report what you have changed.
10 changes: 8 additions & 2 deletions RcppTskit/NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All notable changes to RcppTskit are documented in this file.
The file format is based on [Keep a Changelog](https://keepachangelog.com),
and releases adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.0] - 2026-02-13
## [0.2.0] - 2026-02-22

### Added (new features)

Expand Down Expand Up @@ -35,10 +35,16 @@ and releases adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html

### Maintenance

- Used `\dontrun{}` with `get_tskit_py()` calls in examples to
further reduce `R CMD check time` on CRAN.

- Reduced bundled example tree-sequence sizes in `inst/examples/test.trees`
and `inst/examples/test2.trees` to speed up examples and checks.

- Delete temporary files in examples and tests after use.

- Renamed unexported functions from `RcppTskit:::ts_load_ptr()` to
`RcppTskit:::ts_ptr_load()`.
`RcppTskit:::ts_ptr_load()` style.

## [0.1.0] - 2026-01-26

Expand Down
30 changes: 16 additions & 14 deletions RcppTskit/R/Class-TableCollection.R
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,23 @@ TableCollection <- R6Class(
#' @seealso \code{\link{tc_py_to_r}}, \code{\link{tc_load}}, and
#' \code{\link[=TableCollection]{TableCollection$dump}}.
#' @examples
#' ts_file <- system.file("examples/test.trees", package = "RcppTskit")
#' tc_r <- tc_load(ts_file)
#' is(tc_r)
#' tc_r$print()
#' \dontrun{
#' ts_file <- system.file("examples/test.trees", package = "RcppTskit")
#' tc_r <- tc_load(ts_file)
#' is(tc_r)
#' tc_r$print()
#'
#' # Transfer the table collection to reticulate Python and use tskit Python API
#' tskit <- get_tskit_py()
#' if (check_tskit_py(tskit)) {
#' tc_py <- tc_r$r_to_py()
#' is(tc_py)
#' tmp <- tc_py$simplify(samples = c(0L, 1L, 2L, 3L))
#' tmp
#' tc_py$individuals$num_rows # 2
#' tc_py$nodes$num_rows # 10
#' tc_py$nodes$time # 0.0 ... 7.4702817
#' # Transfer the table collection to reticulate Python and use tskit Python API
#' tskit <- get_tskit_py()
#' if (check_tskit_py(tskit)) {
#' tc_py <- tc_r$r_to_py()
#' is(tc_py)
#' tmp <- tc_py$simplify(samples = c(0L, 1L, 2L, 3L))
#' tmp
#' tc_py$individuals$num_rows # 2
#' tc_py$nodes$num_rows # 8
#' tc_py$nodes$time # 0.0 ... 5.0093910
#' }
#' }
r_to_py = function(tskit_module = get_tskit_py(), cleanup = TRUE) {
tc_ptr_r_to_py(
Expand Down
32 changes: 17 additions & 15 deletions RcppTskit/R/Class-TreeSequence.R
Original file line number Diff line number Diff line change
Expand Up @@ -126,22 +126,24 @@ TreeSequence <- R6Class(
#' @seealso \code{\link{ts_py_to_r}}, \code{\link{ts_load}}, and
#' \code{\link[=TreeSequence]{TreeSequence$dump}}.
#' @examples
#' ts_file <- system.file("examples/test.trees", package = "RcppTskit")
#' ts_r <- ts_load(ts_file)
#' is(ts_r)
#' ts_r$num_individuals() # 80
#' \dontrun{
#' ts_file <- system.file("examples/test.trees", package = "RcppTskit")
#' ts_r <- ts_load(ts_file)
#' is(ts_r)
#' ts_r$num_individuals() # 8
#'
#' # Transfer the tree sequence to reticulate Python and use tskit Python API
#' tskit <- get_tskit_py()
#' if (check_tskit_py(tskit)) {
#' ts_py <- ts_r$r_to_py()
#' is(ts_py)
#' ts_py$num_individuals # 80
#' ts2_py <- ts_py$simplify(samples = c(0L, 1L, 2L, 3L))
#' ts_py$num_individuals # 80
#' ts2_py$num_individuals # 2
#' ts2_py$num_nodes # 10
#' ts2_py$tables$nodes$time # 0.0 ... 7.4702817
#' # Transfer the tree sequence to reticulate Python and use tskit Python API
#' tskit <- get_tskit_py()
#' if (check_tskit_py(tskit)) {
#' ts_py <- ts_r$r_to_py()
#' is(ts_py)
#' ts_py$num_individuals # 8
#' ts2_py <- ts_py$simplify(samples = c(0L, 1L, 2L, 3L))
#' ts_py$num_individuals # 8
#' ts2_py$num_individuals # 2
#' ts2_py$num_nodes # 8
#' ts2_py$tables$nodes$time # 0.0 ... 5.0093910
#' }
#' }
r_to_py = function(tskit_module = get_tskit_py(), cleanup = TRUE) {
ts_ptr_r_to_py(
Expand Down
Loading
Loading