Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
14ed9db
copy instead of clone
tdhock May 15, 2026
02939e8
check for pkg on CRAN
tdhock May 15, 2026
a126d99
poncatime modifs
tdhock May 15, 2026
9e424c7
installed instead of CRAN
tdhock May 15, 2026
3b88312
base.ref in test.env
tdhock May 15, 2026
6af5c7b
install and base.ref
tdhock May 15, 2026
a37f768
remove.units
tdhock May 15, 2026
028cfaa
remove.units
tdhock May 15, 2026
3cc7953
typo
tdhock May 15, 2026
09563ca
use gert instead of git2r
May 19, 2026
3f9e9d4
syntax
May 19, 2026
0da9be9
gert instead of git2r
May 19, 2026
9060497
git submodules and fixes
May 19, 2026
d149c65
DESC
May 19, 2026
c0f2315
gert
May 19, 2026
a260c4a
DESC
May 19, 2026
2a4f0d7
gert in examples
May 19, 2026
5e8aa9e
gert in examples
May 19, 2026
5accbad
system
May 20, 2026
a05b4b5
system
tdhock May 29, 2026
4f412bb
merge
tdhock May 29, 2026
8ddf73d
Merge branch 'main' into poncatime
May 29, 2026
dd8eaf4
check
May 29, 2026
802927d
Merge branch 'main' into poncatime
tdhock May 29, 2026
650f2b4
Merge branch 'main' into poncatime
tdhock May 30, 2026
e0e3a9e
no git2r
tdhock May 30, 2026
5a6dc38
vig
tdhock May 30, 2026
97b4aa4
ci
tdhock May 30, 2026
1567217
tryrci
tdhock May 30, 2026
751dd88
rm container
Jun 12, 2026
93709fa
rapt
Jun 12, 2026
56cc72f
rm
Jun 12, 2026
cb76355
all for suggests
Jun 12, 2026
0296e0b
rm
Jun 12, 2026
56fc52b
cml
Jun 12, 2026
43ae23b
update
Jun 12, 2026
ff72a53
tdhock
Jun 12, 2026
5cfb58f
env
Jun 12, 2026
ac82d71
space
Jun 12, 2026
ad418ee
rm
Jun 12, 2026
d8ef337
rm
Jun 12, 2026
4db40d2
FIRST_COMMENT_ID
tdhock Jun 13, 2026
4c643d7
CURL
tdhock Jun 13, 2026
1e4cd97
CMD
tdhock Jun 13, 2026
482977d
json
tdhock Jun 13, 2026
96b1311
test upload img
tdhock Jun 13, 2026
9e16d49
"
tdhock Jun 13, 2026
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
65 changes: 0 additions & 65 deletions .github/workflows/R-CMD-check.yaml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/build-docs.yaml

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/cml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: update comment
on: [pull_request]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: comment
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.number }}
run: |
ISSUES_API=https://api.github.com/repos/$GITHUB_REPOSITORY/issues
CURL='curl -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2026-03-10"'
PR_API=$ISSUES_API/$PR_NUMBER/comments
FIRST_COMMENT_ID=$($CURL $PR_API?per_page=1 | grep '"id"' | head -1 | sed s/[^0-9]//g)
if [ "$FIRST_COMMENT_ID" == "" ]; then CMD=$PR_API; else CMD=$ISSUES_API/comments/$FIRST_COMMENT_ID; fi; echo $CMD
IURL=$(curl -F "file=@README-figure.png" -F "visibility=unlisted" https://picrd.com/api/upload | sed 's/.*image_url":"//' | sed 's/",".*//')
echo "[![tests-preview-facet.png]($IURL)](https://github.com) is the first comment from json" > comment.md
MD=$(sed 's/"/\\"/g' comment.md | awk '$1=$1' ORS='\\n')
echo '{"body":"'$MD'"}' > pr-comment.json
$CURL -X PATCH -H "Authorization: Bearer $TOKEN" $CMD -d "@pr-comment.json"
56 changes: 0 additions & 56 deletions .github/workflows/test-coverage.yaml

This file was deleted.

13 changes: 8 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
Package: atime
Type: Package
Title: Asymptotic Timing
Version: 2026.5.29
Version: 2026.5.30
Depends: R (>= 3.5.0)
Authors@R: c(
person("Toby", "Hocking",
email="toby.hocking@r-project.org",
role=c("aut", "cre")))
person("Toby", "Hocking",
email="toby.hocking@r-project.org",
role=c("aut", "cre"),
comment = c(ORCID="0000-0002-3146-0865"))
)
Description: Computing and visualizing comparative
asymptotic timings of different algorithms and code versions.
Also includes functionality for comparing empirical timings with
Expand All @@ -17,7 +19,8 @@ Description: Computing and visualizing comparative
License: GPL-3
URL: https://github.com/tdhock/atime, https://atime-docs.netlify.app
BugReports: https://github.com/tdhock/atime/issues
Imports: data.table, bench, lattice, git2r, utils, stats, grDevices
Imports: data.table, bench, lattice, gert, utils, stats, grDevices
SystemRequirements: git command line program
Suggests:
directlabels,
ggplot2,
Expand Down
9 changes: 9 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
Changes in version 2026.5.30

- switched from git2r to gert for running git from R.
- atime_pkg() now works with repos that have sub-modules, via system("git submodule update --init --recursive").
- atime_pkg() now uses label "install" instead of "CRAN" when installed version does not match CRAN version.
- .ci/atime/tests.R can define base.ref="main" for repos where the default branch is not named master.
- .ci/atime/tests.R can define remove.units="kilobytes" for repos where memory benchmarking results should be hidden.
- atime_pkg_test_info() bugfix when pkg is not on CRAN.

Changes in version 2026.5.29

- atime_pkg() now uses only a common subset of columns of the measurements table from each test, so that each test can have different units to analyze.
Expand Down
64 changes: 38 additions & 26 deletions R/test.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ atime_pkg_plot_files <- function(out.dir, test.info, pkg.results){
issue <- character()
for(Test in names(pkg.results)){
atime.list <- pkg.results[[Test]]
if(is.character(test.info$remove.units)){
keep <- !atime.list$unit.col.vec %in% test.info$remove.units
## don't use setdiff() here because it drops names.
atime.list$unit.col.vec <- atime.list$unit.col.vec[keep]
}
best.list <- atime::references_best(atime.list)
ref.dt <- best.list$ref[each.sign.rank==1]
sec.dt <- best.list$meas[unit=="seconds"]
Expand Down Expand Up @@ -309,42 +314,49 @@ atime_pkg_test_info <- function(pkg.path=".", tests.dir=NULL){
pkg.DESC <- file.path(pkg.path, "DESCRIPTION")
DESC.mat <- read.dcf(pkg.DESC)
Package <- DESC.mat[,"Package"]
repo <- git2r::repository(pkg.path)
HEAD.commit <- git2r::revparse_single(repo, "HEAD")
HEAD.commit <- gert::git_commit_id("HEAD",pkg.path)
sha.vec <- c()
HEAD.name <- paste0("HEAD=",git2r::repository_head(repo)$name)
sha.vec[[HEAD.name]] <- git2r::sha(HEAD.commit)
installed_version <- tryCatch(paste(packageVersion(Package)), error=function(e)NULL)
if(!is.null(installed_version)){
CRAN.name <- paste0("CRAN=", installed_version)
sha.vec[[CRAN.name]] <- ""
}else{
HEAD.name <- paste0("HEAD=", gert::git_branch(pkg.path))
sha.vec[[HEAD.name]] <- HEAD.commit
installed_version <- tryCatch(paste(packageVersion(Package)), error=function(e)"(not installed)")
ap <- utils::available.packages()
installed_name <- "installed"
if(Package %in% rownames(ap)){
CRAN_version <- ap[Package,"Version"]
if(identical(CRAN_version, installed_version)){
installed_name <- "CRAN"
}else{
warning(sprintf(
"CRAN version=%s but installed version=%s fix via install.packages('%s')",
CRAN_version, installed_version, Package))
}
}
if(identical(installed_version, "(not installed)")){
CRAN.name <- NA_character_
}else{
CRAN.name <- paste0(installed_name, "=", installed_version)
sha.vec[[CRAN.name]] <- ""
}
ap <- utils::available.packages()
CRAN_version <- ap[Package,"Version"]
if(!identical(CRAN_version, installed_version)){
warning(sprintf(
"CRAN version=%s but installed version=%s fix via install.packages('%s')",
CRAN_version, installed_version, Package))
if(is.null(test.env$base.ref)){
test.env$base.ref <- Sys.getenv("GITHUB_BASE_REF", "master")
}
base.ref <- Sys.getenv("GITHUB_BASE_REF", "master")
base.commit <- tryCatch({
git2r::revparse_single(repo, base.ref)
gert::git_commit_info(test.env$base.ref, pkg.path)$id
}, error=function(e){
NULL
})
base.name <- paste0("base=",base.ref)
if(git2r::is_commit(base.commit)){
add_if_new <- function(name, commit.obj){
sha <- git2r::sha(commit.obj)
if(!sha %in% sha.vec){
sha.vec[[name]] <<- sha
base.name <- paste0("base=", test.env$base.ref)
if(is.character(base.commit)){
maybe.new.list <- list()
maybe.new.list[[base.name]] <- base.commit
maybe.new.list[["merge-base"]] <- gert::git_merge_find_base(
base.commit, "HEAD", pkg.path)
for(maybe.new.name in names(maybe.new.list)){
maybe.new.sha <- maybe.new.list[[maybe.new.name]]
if(!maybe.new.sha %in% sha.vec){
sha.vec[[maybe.new.name]] <- maybe.new.sha
}
}
add_if_new(base.name, base.commit)
mb.commit <- git2r::merge_base(HEAD.commit, base.commit)
add_if_new("merge-base", mb.commit)
}
abbrev2name <- c(
HEAD=HEAD.name,
Expand Down
26 changes: 16 additions & 10 deletions R/versions.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,10 @@ atime_versions_install <- function(Package, pkg.path, new.Package.vec, sha.vec,
## on GH actions windows tempfile() gives C:\Users\RUNNER~1\AppData\Local\Temp\Rtmpc9T5Us/working_dir\Rtmpu23suf\file5d41af35765
tdir <- normalizePath(tempfile(), mustWork=FALSE)
dir.create(tdir)
## pkg.path may be path/to/repo/pkg
## pkg.path may be in a sub-dir of git repo: path/to/repo/pkg
norm.pkg.path <- normalizePath(pkg.path)
orig.repo <- git2r::repository(norm.pkg.path)
## path/to/repo root without trailing /.git
orig.repo.path <- normalizePath(dirname(orig.repo$path))
orig.repo.path <- normalizePath(gert::git_info(pkg.path)$path)
## /pkg
pkg.suffix.in.repo <- sub(orig.repo.path, "", norm.pkg.path, fixed=TRUE)
for(new.i in which(new.not.installed)){
Expand All @@ -78,14 +77,21 @@ atime_versions_install <- function(Package, pkg.path, new.Package.vec, sha.vec,
}else{
new.repo.path <- file.path(tdir, new.Package)
unlink(new.repo.path, recursive=TRUE, force=TRUE)
repo <- git2r::clone(orig.repo.path, new.repo.path, progress=FALSE)
gert::git_clone(orig.repo.path, new.repo.path)
gert::git_branch_create(#and checkout
"atime-versions-testing", sha, repo=new.repo.path)
if(TRUE){
old.wd <- setwd(new.repo.path)
system("git submodule update --init --recursive")
setwd(old.wd)
}else{
submodule_tib <- gert::git_submodule_list(new.repo.path)
for(sub.i in seq_along(submodule_tib$name)){
gert::git_submodule_init(
submodule_tib$name[sub.i], overwrite=TRUE, repo=new.repo.path)
}
}
new.pkg.path <- paste0(new.repo.path, pkg.suffix.in.repo)
tryCatch(
git2r::checkout(repo, branch=sha, force=TRUE),
error=function(e)stop(
e, " when trying to checkout ", sha))
## before editing and installing, make sure directory has sha
## suffix, for windows checks.
unlink(file.path(new.pkg.path, "src", "*.o"))
pkg.edit.fun(
old.Package=Package,
Expand Down
5 changes: 2 additions & 3 deletions man/atime_pkg.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,8 @@ if(FALSE){
## Clone binsegRcpp, and checkout a branch which has performance tests.
tdir <- tempfile()
dir.create(tdir)
git2r::clone("https://github.com/tdhock/binsegRcpp", tdir)
repo <- git2r::repository(tdir)
git2r::checkout(repo, "another-branch")
gert::git_clone("https://github.com/tdhock/binsegRcpp", tdir)
gert::git_branch_checkout("another-branch", repo=tdir)

## Run one test.
info.env <- atime::atime_pkg_test_info(tdir)
Expand Down
6 changes: 3 additions & 3 deletions man/atime_versions.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ atime_versions(
Each version should be either \code{""} (to use currently installed
version of package, or if missing, install most recent
version from CRAN) or a SHA1 hash, which is passed as branch
arg to \code{git2r::checkout}; version names used to identify/interpret
to git checkout; version names used to identify/interpret
the output/plots.
}
\value{list of class atime with elements \code{seconds.limit} (numeric
Expand All @@ -72,7 +72,7 @@ if(FALSE){

tdir <- tempfile()
dir.create(tdir)
git2r::clone("https://github.com/tdhock/binsegRcpp", tdir)
gert::git_clone("https://github.com/tdhock/binsegRcpp", tdir)
atime.list <- atime::atime_versions(
pkg.path=tdir,
setup={
Expand All @@ -89,7 +89,7 @@ if(FALSE){

gdir <- tempfile()
dir.create(gdir)
git2r::clone("https://github.com/tdhock/grates", gdir)
gert::git_clone("https://github.com/tdhock/grates", gdir)
glist <- atime::atime_versions(
file.path(gdir,"pkg"),
current = "1aae646888dcedb128c9076d9bd53fcb4075dcda",
Expand Down
Loading
Loading