Skip to content

Commit

Permalink
add vector type to get_param info fn for #76
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Sep 8, 2022
1 parent 157a42e commit f688d32
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: autotest
Title: Automatic Package Testing
Version: 0.0.2.203
Version: 0.0.2.204
Authors@R: c(
person("Mark", "Padgham", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-2172-5265")),
Expand Down
7 changes: 7 additions & 0 deletions R/function-param-types.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,17 @@ get_param_info <- function (trace_data, fn_pars) {

# param_types are in [single, vector, tabular]
param_types <- rep (NA_character_, nrow (fn_pars_i))

is_single <- vapply (fn_pars_i$length, function (j)
all (as.integer (strsplit (j, ",") [[1]]) <= 1L),
logical (1L))
param_types [which (is_single)] <- "single"

is_vector <- vapply (fn_pars_i$length, function (j)
any (as.integer (strsplit (j, ",") [[1]]) > 1L),
logical (1L))
param_types [which (is_vector)] <- "vector"

is_rect <- vapply (trace_data [par_index], function (j)
j$typeof == "list" && length (dim (j$par_eval)) == 2,
logical (1L))
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"codeRepository": "https://github.com/ropensci-review-tools/autotest",
"issueTracker": "https://github.com/ropensci-review-tools/autotest/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.0.2.203",
"version": "0.0.2.204",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down

0 comments on commit f688d32

Please sign in to comment.