Skip to content

Commit

Permalink
Merge branch 'main' into 0063-unexported-fns
Browse files Browse the repository at this point in the history
  • Loading branch information
ShiyuC authored Jul 24, 2024
2 parents 7a5988e + 97e408e commit 3e9c9da
Show file tree
Hide file tree
Showing 14 changed files with 139 additions and 35 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_docker_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: Get changed files in renv/profiles
id: changed-files
uses: tj-actions/changed-files@v35
uses: tj-actions/changed-files@v41
with:
files: renv/profiles/**/renv.lock

Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
else
echo "platforms=linux/amd64" >> $GITHUB_OUTPUT
fi
- name: Call deploy docker image action for every renv
uses: insightsengineering/r-image-creator@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/r-renv-lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ jobs:
install_min_version("vctrs", "0.4.1")
install_min_version("rlang", "1.0.6")
renv::install("[email protected]", dependencies = "none")
renv::install("[email protected].1", dependencies = "none")
renv::install("[email protected].2", dependencies = "none")
renv::settings$snapshot.type("custom")
renv::snapshot(force = TRUE, prompt = FALSE)
Expand Down
95 changes: 95 additions & 0 deletions .github/workflows/rhub.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# R-hub's generic GitHub Actions workflow file. It's canonical location is at
# https://github.com/r-hub/actions/blob/v1/workflows/rhub.yaml
# You can update this file to a newer version using the rhub2 package:
#
# rhub::rhub_setup()
#
# It is unlikely that you need to modify this file manually.

name: R-hub
run-name: "${{ github.event.inputs.id }}: ${{ github.event.inputs.name || format('Manually run by {0}', github.triggering_actor) }}"

on:
workflow_dispatch:
inputs:
config:
description: 'A comma separated list of R-hub platforms to use.'
type: string
default: 'linux,windows,macos'
name:
description: 'Run name. You can leave this empty now.'
type: string
id:
description: 'Unique ID. You can leave this empty now.'
type: string

jobs:

setup:
runs-on: ubuntu-latest
outputs:
containers: ${{ steps.rhub-setup.outputs.containers }}
platforms: ${{ steps.rhub-setup.outputs.platforms }}

steps:
# NO NEED TO CHECKOUT HERE
- uses: r-hub/actions/setup@v1
with:
config: ${{ github.event.inputs.config }}
id: rhub-setup

linux-containers:
needs: setup
if: ${{ needs.setup.outputs.containers != '[]' }}
runs-on: ubuntu-latest
name: ${{ matrix.config.label }}
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.setup.outputs.containers) }}
container:
image: ${{ matrix.config.container }}

steps:
- uses: r-hub/actions/checkout@v1
- uses: r-hub/actions/platform-info@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/setup-deps@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/run-check@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}

other-platforms:
needs: setup
if: ${{ needs.setup.outputs.platforms != '[]' }}
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.label }}
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.setup.outputs.platforms) }}

steps:
- uses: r-hub/actions/checkout@v1
- uses: r-hub/actions/setup-r@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
- uses: r-hub/actions/platform-info@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/setup-deps@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
- uses: r-hub/actions/run-check@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
1 change: 1 addition & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ https://packagemanager.posit.co/cran/2022-03-10/
https://packagemanager.posit.co/cran/latest
[email protected]
[email protected]
[email protected]
[email protected]
.*@users.noreply.github.com
33 changes: 19 additions & 14 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@ Authors@R: c(
person("Omar", "Garcia", email = "[email protected]", role = "aut"),
person("Ramiro", "Magno", email = "[email protected]",
role = "aut", comment = c(ORCID = "0000-0001-5226-3441")),
person("Kamil", "Sijko", email = "[email protected]",
role = "aut", comment = c(ORCID = "0000-0002-2203-1065")),
person("Shiyu", "Chen", email = "[email protected]",
role = "aut"),
person("Pattern Institute", role = c("cph", "fnd")),
person("F. Hoffmann-La Roche AG", role = c("cph", "fnd")),
person("Pfizer Inc", role = c("cph", "fnd"))
person("Pfizer Inc", role = c("cph", "fnd")),
person("Transition Technologies Science", role = c("cph", "fnd"))
)
Maintainer: Rammprasad Ganapathy <[email protected]>
Description: An EDC and Data Standard-agnostic SDTM data transformation engine
Expand All @@ -33,30 +38,30 @@ URL: https://pharmaverse.github.io/sdtm.oak/, https://github.com/pharmaverse/sdt
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Depends: R (>= 4.2)
Imports:
admiraldev,
admiraldev (>= 1.1.0),
dplyr (>= 1.0.0),
memoise,
assertthat,
purrr (>= 0.3.3),
rlang (>= 0.4.4),
purrr (>= 1.0.1),
rlang (>= 1.0.2),
tibble (>= 3.2.0),
vctrs (>= 0.5.0),
stringr (>= 1.4.0),
tibble,
vctrs,
readr,
glue,
DT,
pillar
memoise (>= 2.0.1),
assertthat,
pillar,
cli
Suggests:
knitr,
htmltools,
lifecycle,
magrittr,
rmarkdown,
spelling,
testthat (>= 3.1.7)
testthat (>= 3.1.7),
DT,
readr
VignetteBuilder: knitr
Config/testthat/edition: 3
Config/testthat/parallel: true
6 changes: 1 addition & 5 deletions R/assertions.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ assert_logical_vector <- function(arg, optional = FALSE) {
}

if (!is.logical(arg)) {
err_msg <- sprintf(
"`arg` must be a logical vector but is %s.",
admiraldev::what_is_it(arg)
)
rlang::abort(err_msg)
cli::cli_abort("`arg` must be a logical vector but is {.obj_type_friendly {arg}}")
}

invisible(arg)
Expand Down
9 changes: 5 additions & 4 deletions R/ct.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ assert_ct_spec <- function(ct_spec, optional = FALSE) {
}

if (!is.null(ct_spec) && anyNA(ct_spec[[ct_spec_vars("ct_clst")]])) {
rlang::abort(glue::glue("`{ct_spec_vars('ct_clst')}` can't have any NA values."))
rlang::abort(stringr::str_glue("`{ct_spec_vars('ct_clst')}` can't have any NA values."))
}

if (!is.null(ct_spec) && anyNA(ct_spec[[ct_spec_vars("to")]])) {
rlang::abort(glue::glue("`{ct_spec_vars('to')}` can't have any NA values."))
rlang::abort(stringr::str_glue("`{ct_spec_vars('to')}` can't have any NA values."))
}

invisible(ct_spec)
Expand Down Expand Up @@ -279,7 +279,8 @@ ct_map <-
#'
#' @export
read_ct_spec <- function(file = stop("`file` must be specified")) {
ct_spec <- readr::read_csv(file = file, col_types = "c")
ct_spec <- utils::read.csv(file = file, na.strings = c("NA", ""), colClasses = "character") |>
tibble::as_tibble()
assert_ct_spec(ct_spec)

ct_spec
Expand Down Expand Up @@ -327,7 +328,7 @@ ct_spec_example <- function(example) {

if (identical(local_path, "")) {
stop(
glue::glue(
stringr::str_glue(
"'{example}' does not match any ct spec files. Run `ct_spec_example()` for options."
),
call. = FALSE
Expand Down
1 change: 0 additions & 1 deletion R/derive_blfl.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ dtc_datepart <- function(dtc, partial_as_na = TRUE) {
#' @return Character vector containing ISO 8601 times.
#'
#' @keywords internal

dtc_timepart <- function(dtc, partial_as_na = TRUE, ignore_seconds = TRUE) {
# Assert that dtc is a character vector
admiraldev::assert_character_vector(dtc)
Expand Down
7 changes: 5 additions & 2 deletions R/domain_example.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ domain_example <- function(example) {

if (identical(local_path, "")) {
stop(
glue::glue(
stringr::str_glue(
"'{example}' does not match any domain example files. Run `domain_example()` for options."
),
call. = FALSE
Expand Down Expand Up @@ -125,5 +125,8 @@ read_domain_example <- function(example) {
}

path <- domain_example(example)
readr::read_rds(file = path)
con <- file(path)
on.exit(close(con))

readRDS(con)
}
1 change: 1 addition & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ reference:
contents:
- assign
- harcode
- derive_blfl
- derive_seq
- derive_study_day
- assign_datetime
Expand Down
3 changes: 3 additions & 0 deletions man/sdtm.oak-package.Rd

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

4 changes: 2 additions & 2 deletions renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,7 @@
},
"roxygen2": {
"Package": "roxygen2",
"Version": "7.3.1",
"Version": "7.3.2",
"Source": "Repository",
"Repository": "RSPM",
"Requirements": [
Expand All @@ -1187,7 +1187,7 @@
"withr",
"xml2"
],
"Hash": "c25fe7b2d8cba73d1b63c947bf7afdb9"
"Hash": "6ee25f9054a70f44d615300ed531ba8d"
},
"rprojroot": {
"Package": "rprojroot",
Expand Down
4 changes: 2 additions & 2 deletions renv/profiles/4.2/renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,7 @@
},
"roxygen2": {
"Package": "roxygen2",
"Version": "7.3.1",
"Version": "7.3.2",
"Source": "Repository",
"Repository": "RSPM",
"Requirements": [
Expand All @@ -1187,7 +1187,7 @@
"withr",
"xml2"
],
"Hash": "c25fe7b2d8cba73d1b63c947bf7afdb9"
"Hash": "6ee25f9054a70f44d615300ed531ba8d"
},
"rprojroot": {
"Package": "rprojroot",
Expand Down
4 changes: 2 additions & 2 deletions renv/profiles/4.3/renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,7 @@
},
"roxygen2": {
"Package": "roxygen2",
"Version": "7.3.1",
"Version": "7.3.2",
"Source": "Repository",
"Repository": "RSPM",
"Requirements": [
Expand All @@ -1187,7 +1187,7 @@
"withr",
"xml2"
],
"Hash": "c25fe7b2d8cba73d1b63c947bf7afdb9"
"Hash": "6ee25f9054a70f44d615300ed531ba8d"
},
"rprojroot": {
"Package": "rprojroot",
Expand Down

0 comments on commit 3e9c9da

Please sign in to comment.