Skip to content

Commit c6b7cb7

Browse files
authored
Merge pull request #96 from ropensci-review-tools/dev-resp
fix return value of model for dev responsiveness #87
2 parents 074e4e7 + 88e23ba commit c6b7cb7

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: repometrics
22
Title: Metrics for Your Code Repository
3-
Version: 0.1.5.026
3+
Version: 0.1.5.028
44
Authors@R:
55
person("Mark", "Padgham", , "mark.padgham@email.com", role = c("aut", "cre"),
66
comment = c(ORCID = "0000-0003-2172-5265"))

R/cm-models.R

+7-4
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
#' measured in both mean and median forms, and converts all measured values to
1414
#' aggregate mean and median values.
1515
#'
16-
#' @return A numeric vector of two values for mean and median of overall
17-
#' response durations.
16+
#' @return A single numeric value of the mean of all of the four values. As
17+
#' this is in days, it is converted to log 10, with both NA values and values <
18+
#' 1 converted to values of 1 prior to log.
1819
#'
1920
#' @noRd
2021
cm_model_dev_responsiveness <- function (path,
@@ -53,8 +54,10 @@ cm_model_dev_responsiveness <- function (path,
5354
names (vals) <- c ("mean", "median")
5455
vals [which (is.na (vals))] <- NA_real_
5556

56-
# But only return mean value, to align with all others:
57-
return (vals [["mean"]])
57+
# But only return mean value, to align with all others
58+
val <- vals [["mean"]]
59+
val <- ifelse (is.na (val) | val < 1, 1, val)
60+
return (log10 (val))
5861
}
5962

6063
#' CHAOSS model "project engagement"

R/data-gh-workflow.R

+3-1
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,7 @@ coverage_from_one_log <- function (log_url) {
100100
fs::dir_delete (dirs_new)
101101
}
102102

103-
return (max (cov))
103+
cov <- ifelse (length (cov) == 0L, NA_real_, max (cov))
104+
105+
return (cov)
104106
}

codemeta.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"codeRepository": "https://github.com/ropensci-review-tools/repometrics",
99
"issueTracker": "https://github.com/ropensci-review-tools/repometrics/issues",
1010
"license": "https://spdx.org/licenses/GPL-3.0",
11-
"version": "0.1.5.026",
11+
"version": "0.1.5.028",
1212
"programmingLanguage": {
1313
"@type": "ComputerLanguage",
1414
"name": "R",

0 commit comments

Comments
 (0)