Skip to content

Commit

Permalink
Use package 'rutils' in place of 'gutils'
Browse files Browse the repository at this point in the history
  • Loading branch information
danielvartan committed Sep 26, 2023
1 parent 3b2128b commit 8250847
Show file tree
Hide file tree
Showing 27 changed files with 161 additions and 190 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/lint.yaml

This file was deleted.

67 changes: 35 additions & 32 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -----------------------------------------------------------
# CITATION file created with {cffr} R package, v0.4.1
# CITATION file created with {cffr} R package, v0.5.0
# See also: https://docs.ropensci.org/cffr/
# -----------------------------------------------------------

Expand Down Expand Up @@ -45,7 +45,7 @@ references:
year: '2023'
institution:
name: R Foundation for Statistical Computing
version: '>= 4.1'
version: '>= 4.2'
- type: software
title: checkmate
abstract: 'checkmate: Fast and Versatile Argument Checks'
Expand All @@ -66,8 +66,8 @@ references:
url: https://cli.r-lib.org
repository: https://CRAN.R-project.org/package=cli
authors:
- family-names: Csardi
given-names: Gabor
- family-names: Csárdi
given-names: Gábor
email: csardi.gabor@gmail.com
year: '2023'
version: '>= 3.6.0'
Expand All @@ -82,12 +82,12 @@ references:
given-names: Hadley
email: hadley@posit.co
orcid: https://orcid.org/0000-0003-4757-117X
- family-names: Francois
- family-names: François
given-names: Romain
orcid: https://orcid.org/0000-0002-2444-4226
- family-names: Henry
given-names: Lionel
- family-names: Muller
- family-names: Müller
given-names: Kirill
orcid: https://orcid.org/0000-0002-1416-3412
- family-names: Vaughan
Expand All @@ -105,21 +105,10 @@ references:
authors:
- family-names: Bryan
given-names: Jennifer
email: jenny@rstudio.com
email: jenny@posit.co
orcid: https://orcid.org/0000-0002-6983-2759
year: '2023'
version: '>= 1.0.1'
- type: software
title: gutils
abstract: 'gutils: Utility Functions Created by the GIPERBIO Developer Team'
notes: Imports
url: https://giperbio.github.io/gutils/
authors:
- family-names: Vartanian
given-names: Daniel
email: danvartan@gmail.com
orcid: https://orcid.org/0000-0001-7782-759X
year: '2023'
- type: software
title: lifecycle
abstract: 'lifecycle: Manage the Life Cycle of your Package Functions'
Expand Down Expand Up @@ -156,10 +145,10 @@ references:
authors:
- family-names: Henry
given-names: Lionel
email: lionel@rstudio.com
email: lionel@posit.co
- family-names: Wickham
given-names: Hadley
email: hadley@rstudio.com
email: hadley@posit.co
year: '2023'
version: '>= 1.0.6'
- type: software
Expand All @@ -174,6 +163,17 @@ references:
email: hadley@rstudio.com
year: '2023'
version: '>= 1.5.0'
- type: software
title: rutils
abstract: 'rutils: Utility Functions for R'
notes: Imports
url: https://danielvartan.github.io/rutils/
authors:
- family-names: Vartanian
given-names: Daniel
email: danvartan@gmail.com
orcid: https://orcid.org/0000-0001-7782-759X
year: '2023'
- type: software
title: covr
abstract: 'covr: Test Coverage for Packages'
Expand Down Expand Up @@ -206,7 +206,7 @@ references:
url: https://krlmlr.github.io/mockr/
repository: https://CRAN.R-project.org/package=mockr
authors:
- family-names: M<U+00FC>ller
- family-names: Müller
given-names: Kirill
email: kirill@cynkra.com
year: '2023'
Expand All @@ -220,35 +220,38 @@ references:
authors:
- family-names: Allaire
given-names: JJ
email: jj@rstudio.com
email: jj@posit.co
- family-names: Xie
given-names: Yihui
email: xie@yihui.name
orcid: https://orcid.org/0000-0003-0645-5666
- family-names: Dervieux
given-names: Christophe
email: cderv@posit.co
orcid: https://orcid.org/0000-0003-4474-2498
- family-names: McPherson
given-names: Jonathan
email: jonathan@rstudio.com
email: jonathan@posit.co
- family-names: Luraschi
given-names: Javier
email: javier@rstudio.com
- family-names: Ushey
given-names: Kevin
email: kevin@rstudio.com
email: kevin@posit.co
- family-names: Atkins
given-names: Aron
email: aron@rstudio.com
email: aron@posit.co
- family-names: Wickham
given-names: Hadley
email: hadley@rstudio.com
email: hadley@posit.co
- family-names: Cheng
given-names: Joe
email: joe@rstudio.com
email: joe@posit.co
- family-names: Chang
given-names: Winston
email: winston@rstudio.com
email: winston@posit.co
- family-names: Iannone
given-names: Richard
email: rich@rstudio.com
email: rich@posit.co
orcid: https://orcid.org/0000-0003-3925-190X
year: '2023'
version: '>= 2.20'
Expand Down Expand Up @@ -277,7 +280,7 @@ references:
authors:
- family-names: Wickham
given-names: Hadley
email: hadley@rstudio.com
email: hadley@posit.co
year: '2023'
version: '>= 3.1.6'
- type: software
Expand All @@ -291,7 +294,7 @@ references:
year: '2023'
institution:
name: R Foundation for Statistical Computing
version: '>= 4.1.0'
version: '>= 4.2.0'
identifiers:
- type: url
value: https://github.com/giperbio/sqlr/
12 changes: 6 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,28 @@ License: MIT + file LICENSE
URL: https://giperbio.github.io/sqlr/, https://github.com/giperbio/sqlr/
BugReports: https://github.com/giperbio/sqlr/issues/
Depends:
R (>= 4.1)
R (>= 4.2)
Imports:
checkmate (>= 2.1.0),
cli (>= 3.6.0),
dplyr (>= 1.1.0),
googlesheets4 (>= 1.0.1),
gutils,
lifecycle (>= 1.0.3),
refstudio,
rlang (>= 1.0.6),
stringr (>= 1.5.0)
stringr (>= 1.5.0),
rutils
Suggests:
covr (>= 3.6.1),
knitr (>= 1.42),
mockr (>= 0.2.1),
rmarkdown (>= 2.20),
spelling (>= 2.2),
testthat (>= 3.1.6),
utils (>= 4.1.0)
utils (>= 4.2.0)
Remotes:
github::giperbio/gutils,
github::giperbio/refstudio
github::danielvartan/refstudio,
github::danielvartan/rutils
VignetteBuilder:
knitr
Config/testthat/edition: 3
Expand Down
36 changes: 18 additions & 18 deletions R/build_reference.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@
#' @examples
#' \dontrun{
#' build_reference()}
build_reference <- function(package = gutils:::get_package_name(),
build_reference <- function(package = rutils:::get_package_name(),
write = TRUE) {
checkmate::assert_string(package, null.ok = TRUE)
checkmate::assert_flag(write)
gutils:::require_pkg("utils", "googlesheets4")
rutils:::require_pkg("utils", "googlesheets4")

# R CMD Check variable bindings fix
sheets <- NULL

gutils:::assert_namespace(package)
gutils:::assert_data("sheets", package)
rutils:::assert_namespace(package)
rutils:::assert_data("sheets", package)

utils::data("sheets", package = package, envir = environment())
choices <- c("source", "search")
checkmate::assert_subset(choices, names(sheets))

if (isTRUE(write)) {
gutils:::assert_interactive()
rutils:::assert_interactive()
checkmate::assert_subset("reference", names(sheets))

googlesheets4::gs4_auth()
Expand All @@ -60,12 +60,12 @@ build_reference <- function(package = gutils:::get_package_name(),
invisible(out)
}

read_ref_extdata <- function(package = gutils:::get_package_name()) {
read_ref_extdata <- function(package = rutils:::get_package_name()) {
checkmate::assert_string(package, null.ok = TRUE)
gutils:::assert_namespace(package)
rutils:::assert_namespace(package)

gutils::normalize_extdata(package)
files <- gutils::raw_data_2("reference", package = package)
rutils::normalize_extdata(package)
files <- rutils::raw_data_2("reference", package = package)

if (length(files) == 0) {
stop("The 'reference' folder is empty.", call. = FALSE)
Expand All @@ -80,8 +80,8 @@ read_ref_extdata <- function(package = gutils:::get_package_name()) {
lookup <- stringr::str_extract(i, pattern)
lookup <- stringr::str_replace(lookup, "^web-of-science$", "wos")

i <- gutils::raw_data_2("reference", i, package = package)
data <- gutils:::shush(refstudio::read_ref(i, lookup = lookup))
i <- rutils::raw_data_2("reference", i, package = package)
data <- rutils:::shush(refstudio::read_ref(i, lookup = lookup))
out <- dplyr::bind_rows(out, data)
}

Expand Down Expand Up @@ -198,10 +198,10 @@ identify_ref_duplicates <- function(x) {
x
}

assign_ref_ids <- function(x, package = gutils:::get_package_name()) {
assign_ref_ids <- function(x, package = rutils:::get_package_name()) {
checkmate::assert_data_frame(x, min.rows = 1)
checkmate::assert_string(package, null.ok = TRUE)
gutils:::assert_namespace(package)
rutils:::assert_namespace(package)

# R CMD Check variable bindings fix
# nolint start: object_usage_linter.
Expand All @@ -210,24 +210,24 @@ assign_ref_ids <- function(x, package = gutils:::get_package_name()) {
pdf <- NULL
# nolint end

gutils:::assert_data("sheets", package)
rutils:::assert_data("sheets", package)
utils::data("sheets", package = package, envir = environment())

gutils:::assert_data("source", package)
rutils:::assert_data("source", package)
utils::data("source", package = package, envir = environment())

gutils:::assert_data("search", package)
rutils:::assert_data("search", package)
utils::data("search", package = package, envir = environment())

cli::cli_alert_info("Assigning IDs and finalizing the dataset.")

lookup_builder <- function(provider, id, filter = NULL) {
checkmate::assert_character(provider)
gutils:::assert_identical(provider, id, type = "length",
rutils:::assert_identical(provider, id, type = "length",
any.missing = FALSE, null.ok = FALSE)
checkmate::assert_logical(filter, min.len = 1, null.ok = TRUE)

id <- gutils:::shush(as.integer(id))
id <- rutils:::shush(as.integer(id))

if (!is.null(filter)) {
provider <- provider[filter]
Expand Down
8 changes: 4 additions & 4 deletions R/keyword_set.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
#' \dontrun{
#' keyword_set(1, "english")}
keyword_set <- function(domain_id, language = NULL,
package = gutils:::get_package_name()) {
package = rutils:::get_package_name()) {
checkmate::assert_integerish(domain_id)
checkmate::assert_string(language, null.ok = TRUE)
checkmate::assert_string(package, null.ok = TRUE)
gutils:::require_pkg("utils")
rutils:::require_pkg("utils")

gutils:::assert_namespace(package)
gutils:::assert_data("keyword", package)
rutils:::assert_namespace(package)
rutils:::assert_data("keyword", package)

keyword <- approval <- NULL # R CMD Check variable bindings fix

Expand Down
2 changes: 1 addition & 1 deletion R/raw_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
#' raw_data()
#' }
raw_data <- function(type = NULL, file = NULL) {
gutils::raw_data_2(type, file, package = "sqlr")
rutils::raw_data_2(type, file, package = "sqlr")
}
Loading

0 comments on commit 8250847

Please sign in to comment.