Skip to content

Commit

Permalink
fix extraction of param_call from get_param_info for #76
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Sep 8, 2022
1 parent f688d32 commit 43949cc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 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.204
Version: 0.0.2.205
Authors@R: c(
person("Mark", "Padgham", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-2172-5265")),
Expand Down
20 changes: 13 additions & 7 deletions R/function-param-types.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,21 @@ get_param_info <- function (trace_data, fn_pars) {
logical (1L))
param_types [which (is_rect)] <- "tabular"

# reduce class to first value only
param_class <- gsub (",\\s.*$", "", fn_pars_i$class)
names (param_class) <- fn_pars_i$par_name
index <- which (!param_class %in% c (atomic_modes (), "data.frame"))
param_class <- param_class [index]
# reduce class to first non-generic value only
# start by removing generic classes, which may be first of several items, so
# first remove all ", " versions.
atomics <- paste0 (atomic_modes (), collapse = "|")
atomics <- paste0 (atomics, "|matrix|array|data\\.frame")
ptn <- paste0 ("(", atomics, "),\\s*")
param_class <- gsub (ptn, "", fn_pars_i$class)
param_class <- gsub (atomics, "", param_class)
param_class <- gsub ("^\\,\\s+", "", param_class)

list (
param_class [which (!nzchar (param_class))] <- NA_character_

data.frame (
name = par_names_i,
value = par_vals_i,
value = I (par_vals_i),
type = param_types,
class = param_class,
storage_mode = fn_pars_i$storage_mode
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.204",
"version": "0.0.2.205",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down

0 comments on commit 43949cc

Please sign in to comment.