-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
167 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
atime_test <- function(...){ | ||
as.list(match.call()[-1]) | ||
} | ||
|
||
atime_test_list <- function(..., N, setup, expr, times, seconds.limit, verbose, pkg.edit.fun, result, tests=NULL){ | ||
could.copy <- intersect(names(formals(atime_versions)),names(formals())) | ||
mc <- as.list(match.call()[-1]) | ||
copy.names <- intersect(names(mc), could.copy) | ||
L <- c(tests, list(...)) | ||
out <- list() | ||
for(L.i in seq_along(L)){ | ||
test.args <- L[[L.i]] | ||
test.name <- names(L)[[L.i]] | ||
if(!is.null(test.args)){ | ||
test.args[copy.names] <- mc[copy.names] | ||
out[[test.name]] <- test.args | ||
} | ||
} | ||
out | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
\name{atime_test} | ||
\alias{atime_test} | ||
\title{ | ||
Define an atime performance test. | ||
} | ||
\description{ | ||
Use this to define an element of your \code{test.list} in | ||
atime/tests.R, prior to running \code{\link{atime_pkg}}. | ||
} | ||
\usage{ | ||
atime_test(...) | ||
} | ||
\arguments{ | ||
\item{\dots}{ | ||
Any arguments for \code{\link{atime_versions}}, will be quoted (not evaluated). | ||
} | ||
} | ||
\value{ | ||
List of expressions. | ||
} | ||
\author{ | ||
Toby Dylan Hocking | ||
} | ||
\seealso{ | ||
\code{\link{atime_test_list}} for defining common arguments in each | ||
element of the test list, | ||
\code{\link{atime_pkg}} for running tests. | ||
} | ||
\examples{ | ||
|
||
atime::atime_test( | ||
setup=data.vec <- rnorm(N), | ||
expr=binsegRcpp::binseg("mean_norm",data.vec)) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
\name{atime_test_list} | ||
\alias{atime_test_list} | ||
\title{ | ||
Define an atime performance test list. | ||
} | ||
\description{ | ||
Use this to define \code{test.list} in your atime/tests.R | ||
file, prior to running \code{\link{atime_pkg}}. | ||
Arguments in \dots and \code{tests} are combined to form the test | ||
list, and other arguments are copied to each element of the test list. | ||
} | ||
\usage{ | ||
atime_test_list(..., N, setup, expr, times, seconds.limit, verbose, pkg.edit.fun, result, tests = NULL) | ||
} | ||
\arguments{ | ||
\item{\dots}{ | ||
names for tests, values are lists of arguments to pass to | ||
\code{\link{atime_versions}} (combined with \code{tests}). | ||
} | ||
\item{tests}{ | ||
list of tests, with names for tests, values are lists of arguments to pass to | ||
\code{\link{atime_versions}} (combined with \dots). | ||
} | ||
\item{N}{ | ||
integer vector of data sizes. | ||
} | ||
\item{setup}{ | ||
expression that depends on \code{N}, to run before timings. | ||
} | ||
\item{expr}{ | ||
expression to time. | ||
} | ||
\item{times}{ | ||
number of times to run \code{expr}. | ||
} | ||
\item{seconds.limit}{ | ||
number of seconds after which we stop trying larger \code{N}. | ||
} | ||
\item{verbose}{ | ||
logical: print output? | ||
} | ||
\item{pkg.edit.fun}{ | ||
function for editing package prior to testing. | ||
} | ||
\item{result}{ | ||
logical: save results? | ||
} | ||
} | ||
\value{ | ||
List representing performance tests, each element is a list of | ||
arguments to pass to \code{\link{atime_versions}}. | ||
} | ||
\author{ | ||
Toby Dylan Hocking | ||
} | ||
\seealso{ | ||
\code{\link{atime_test}} for defining each test, | ||
\code{\link{atime_pkg}} for running tests. | ||
} | ||
\examples{ | ||
|
||
test.list <- atime::atime_test_list( | ||
N=as.integer(10^seq(1,3,by=0.5)), | ||
setup={ | ||
set.seed(1) | ||
data.vec <- rnorm(N) | ||
}, | ||
mean_norm=atime::atime_test(expr=binsegRcpp::binseg("mean_norm",data.vec)), | ||
poisson=atime::atime_test(expr=binsegRcpp::binseg("poisson",data.vec)), | ||
NULL) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters