Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
88 changes: 34 additions & 54 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,70 +1,58 @@
Package: val.meter
Title:
validation-ready package quantification supporting regulatory use of R
Title:validation-ready package quantification supporting regulatory use
of R
Version: 0.0.0.9000
Authors@R:
c(
person(
"Doug", "Kelkhoff",
email = "doug.kelkhoff@gmail.com",
role = c("aut", "cre")
),
person(
"Aaron", "Clark",
email = "clark.aaronchris@gmail.com",
role = c("ctb")
),
person(
"R Validation Hub",
email = "r-val-hub-maintainers@lists.r-consortium.org",
comment = c("website" = "https://www.pharmar.org"),
role = c("cph")
)
)
Description:
Measures packages for common best practices, adoption and code execution.
Built with regulated industries in mind, supporting the surveying of
packages and aggregating findings into a portable format to support
activities like selecting mature packages and reporting on risk-based
software decision-making.
Authors@R: c(
person("Doug", "Kelkhoff", , "doug.kelkhoff@gmail.com", role = c("aut", "cre")),
person("Aaron", "Clark", , "clark.aaronchris@gmail.com", role = "ctb"),
person("Lluís", "Revilla Sancho", , "lluis.revilla@gmail.com", role = "ctb",
comment = c(ORCID = "0000-0001-9747-2570")),
person("R Validation Hub", , , "r-val-hub-maintainers@lists.r-consortium.org", role = "cph",
comment = c(website = "https://www.pharmar.org"))
)
Description:Measures packages for common best practices, adoption and
code execution. Built with regulated industries in mind, supporting
the surveying of packages and aggregating findings into a portable
format to support activities like selecting mature packages and
reporting on risk-based software decision-making.
License: MIT + file LICENSE
URL:
https://pharmar.github.io/val.meter,
https://github.com/pharmar/val.meter,
https://pharmar.org/
BugReports:
https://github.com/pharmaR/val.meter/issues
URL: https://pharmar.github.io/val.meter,
https://github.com/pharmar/val.meter, https://pharmar.org/
BugReports:https://github.com/pharmaR/val.meter/issues
Depends:
R (>= 3.5)
Imports:
cli,
desc,
evaluate,
httr2,
jsonlite,
options,
S7,
stats,
tools,
utils,
stats,
jsonlite,
httr2,
xml2
Suggests:
covr,
rcmdcheck,
htmltools,
igraph,
knitr,
rcmdcheck,
rmarkdown,
rosv,
testthat (>= 3.0.0),
withr
Config/Needs/vignettes:
knitr,
rmarkdown,
rosv,
testthat (>= 3.0.0)
Config/Needs/readme:
asciicast
Config/Needs/data:
tidytext
VignetteBuilder:
knitr
Config/Needs/data:tidytext
Config/Needs/readme:asciicast
Config/Needs/vignettes:knitr, rmarkdown, rosv, testthat (>= 3.0.0)
Config/roxygen2/version: 8.1.0
Config/testthat/edition: 3
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
Collate:
'utils_enum_vector.R'
'class_tags.R'
Expand Down Expand Up @@ -108,11 +96,3 @@ Collate:
'utils_rstudio.R'
'utils_tmp.R'
'zzz.R'
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.3
Depends:
R (>= 3.5)
LazyData: true
VignetteBuilder: knitr
Config/testthat/edition: 3
54 changes: 32 additions & 22 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,36 @@ import(cli)
import(options)
importFrom(desc,desc)
importFrom(evaluate,replay)
importFrom(httr2,req_perform)
importFrom(httr2,request)
importFrom(httr2,resp_body_html)
importFrom(httr2,
req_perform,
request,
resp_body_html
)
Comment thread
dgkf marked this conversation as resolved.
importFrom(jsonlite,read_json)
importFrom(stats,rbinom)
importFrom(stats,rpois)
importFrom(stats,runif)
importFrom(tools,dependsOnPkgs)
importFrom(tools,file_ext)
importFrom(tools,getVignetteInfo)
importFrom(tools,toRd)
importFrom(utils,.DollarNames)
importFrom(utils,available.packages)
importFrom(utils,capture.output)
importFrom(utils,download.file)
importFrom(utils,download.packages)
importFrom(utils,getCRANmirrors)
importFrom(utils,head)
importFrom(utils,install.packages)
importFrom(utils,packageName)
importFrom(utils,packageVersion)
importFrom(xml2,xml_attrs)
importFrom(xml2,xml_find_all)
importFrom(stats,
rbinom,
rpois,
runif
)
importFrom(tools,
dependsOnPkgs,
file_ext,
getVignetteInfo,
toRd
)
importFrom(utils,
.DollarNames,
available.packages,
capture.output,
download.file,
download.packages,
getCRANmirrors,
head,
install.packages,
packageName,
packageVersion
)
importFrom(xml2,
xml_attrs,
xml_find_all
)
10 changes: 6 additions & 4 deletions R/data_desc.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#' @include impl_data.R

source_code_or_install <- new_union(source_code_resource, install_resource)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
source_code_or_install <- new_union(source_code_resource, install_resource)
source_code_or_install_resource <- new_union(source_code_resource, install_resource)

I know this name gets long, but I think we should be consistent, even if verbose. If we can't be consistent because of the variable length, we should instead find a consistent shorthand, (eg inst_rsrc, src_rsrc, src_or_inst_rsrc). But for critical workflows, I think we should tolerate verbosity to be as clear as possible.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's first resolve if we keep it or not, but I don't think adding the suffix makes it too long, so I agree with the suggested change.


#' @importFrom desc desc
impl_data(
"desc",
class = c("description", "R6"),
for_resource = new_union(source_code_resource, install_resource),
for_resource = source_code_or_install,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for my own knowledge, is this for performance reasons?

Personally, I kinda prefer the type union for transparency. Conceptually, the source code and install resources are quite different and we just happen to be able to use the same syntactic code to evaluate both because of how desc() works. I'm a bit reluctant to convert all of our type unions into symbols in the package namespace because I fear it will be too easy to end up with redundant types (source_code_or_install and install_or_source_code).

If it's for performance reasons, maybe we can wrap this in a local()?

But it's not a strong conviction and happy to hear your thoughts on the right path here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was experimenting with new_union() and I moved out this code as I saw it as redunant. I can revert the change as it won't give use big performance gains.

function(pkg, resource, field, ...) {
desc::desc(resource@path)
}
Expand All @@ -14,7 +16,7 @@ impl_data(
"name",
title = "Package name",
class = class_character,
for_resource = new_union(source_code_resource, install_resource),
for_resource = source_code_or_install,
function(pkg, resource, field, ...) {
pkg$desc$get_field("Package")
}
Expand All @@ -31,7 +33,7 @@ impl_data(
impl_data(
"version",
class = class_character,
for_resource = new_union(source_code_resource, install_resource),
for_resource = source_code_or_install,
function(pkg, resource, field, ...) {
pkg$desc$get_field("Version")
}
Expand All @@ -48,7 +50,7 @@ impl_data(
impl_data(
"md5",
class = class_character,
for_resource = new_union(source_code_resource, install_resource),
for_resource = source_code_or_install,
function(pkg, resource, field, ...) {
pkg$desc$get_field("MD5sum")
}
Expand Down
2 changes: 1 addition & 1 deletion R/data_has_current_news.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl_data(
#' @importFrom tools file_ext
impl_data(
"has_current_news",
for_resource = new_union(install_resource, source_code_resource),
for_resource = source_code_or_install,
overwrite = TRUE,
function(pkg, resource, field, ...) {
files <- resource@path |>
Expand Down
2 changes: 1 addition & 1 deletion R/generic_pkg_data_derive.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ method(
#' @noRd
method(
pkg_data_derive,
list(class_pkg, new_union(NULL, class_missing), class_any)
list(class_pkg, class_missing | new_S3_class("NULL"), class_any)
) <-
function(pkg, resource, field, ...) {
pkg_data_derive(pkg = pkg, resource = pkg@resource, field = field, ...)
Expand Down
2 changes: 1 addition & 1 deletion man/class_metric_data_frame.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/class_package_matrix.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 16 additions & 16 deletions man/cran_repo_resource.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions man/errors.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/format_output.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 14 additions & 14 deletions man/git_resource.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 14 additions & 14 deletions man/http_resource.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading