From ea309623e48a9364ba00905c63e72c59d790b81a Mon Sep 17 00:00:00 2001 From: edward-burn <9583964+edward-burn@users.noreply.github.com> Date: Tue, 12 Nov 2024 20:24:48 +0000 Subject: [PATCH] v0.3.2 --- DESCRIPTION | 2 +- cran-comments.md | 2 +- tests/testthat/test-collapseCohorts.R | 2 ++ tests/testthat/test-conceptCohort.R | 6 ++++-- tests/testthat/test-intersectCohorts.R | 16 ++++++++++++++++ tests/testthat/test-matchCohorts.R | 6 ++++++ tests/testthat/test-measurementCohort.R | 2 ++ tests/testthat/test-padCohortDate.R | 6 ++++++ tests/testthat/test-unionCohorts.R | 6 ++++++ 9 files changed, 44 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 97bc8344..06898dea 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: CohortConstructor Title: Build and Manipulate Study Cohorts Using a Common Data Model -Version: 0.3.1.900 +Version: 0.3.2 Authors@R: c( person("Edward", "Burn", , "edward.burn@ndorms.ox.ac.uk", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-9286-1128")), diff --git a/cran-comments.md b/cran-comments.md index f12cc45b..e7ab6ec5 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,3 +1,3 @@ ## R CMD check results -This is a patch releasing, fixing a small issue from the previous release. +This is a new release. diff --git a/tests/testthat/test-collapseCohorts.R b/tests/testthat/test-collapseCohorts.R index 257603d7..53db286f 100644 --- a/tests/testthat/test-collapseCohorts.R +++ b/tests/testthat/test-collapseCohorts.R @@ -192,6 +192,7 @@ test_that("out of observation", { }) test_that("infitine", { + skip_on_cran() cdm <- omock::mockCdmFromTables() cdm$person <- dplyr::tibble( @@ -249,6 +250,7 @@ test_that("infitine", { test_that("multiple observation periods", { # collapse should respect observation end dates + skip_on_cran() cdm <- omock::mockCdmReference() |> omock::mockCdmFromTables(tables = list("cohort" = dplyr::tibble( diff --git a/tests/testthat/test-conceptCohort.R b/tests/testthat/test-conceptCohort.R index 07c9375f..49ce7f2a 100644 --- a/tests/testthat/test-conceptCohort.R +++ b/tests/testthat/test-conceptCohort.R @@ -554,7 +554,8 @@ test_that("table not present in the cdm", { }) test_that("cohort exit as event start date", { - cdm <- omock::mockCdmReference() |> + skip_on_cran() + cdm <- omock::mockCdmReference() |> omock::mockCdmFromTables(tables = list("cohort" = dplyr::tibble( "cohort_definition_id" = 1L, "subject_id" = c(1L, 2L, 3L), @@ -625,7 +626,8 @@ test_that("cohort exit as event start date", { }) test_that("use source field concepts", { - cdm <- omock::mockCdmReference() |> + skip_on_cran() + cdm <- omock::mockCdmReference() |> omock::mockCdmFromTables(tables = list("cohort" = dplyr::tibble( "cohort_definition_id" = 1L, "subject_id" = c(1L, 2L, 3L), diff --git a/tests/testthat/test-intersectCohorts.R b/tests/testthat/test-intersectCohorts.R index 3228513d..8d6519ef 100644 --- a/tests/testthat/test-intersectCohorts.R +++ b/tests/testthat/test-intersectCohorts.R @@ -46,6 +46,8 @@ test_that("intersect example - two cohorts", { }) test_that("intersect example - three cohorts", { + skip_on_cran() + cdm_local <- omock::mockCdmReference() |> omock::mockPerson(n = 2) cdm_local <- omopgenerics::insertTable( @@ -95,6 +97,8 @@ test_that("intersect example - three cohorts", { }) test_that("intersect example - nobody with intersection", { + skip_on_cran() + cdm_local <- omock::mockCdmReference() |> omock::mockPerson(n = 2) cdm_local <- omopgenerics::insertTable( @@ -140,6 +144,8 @@ test_that("intersect example - nobody with intersection", { }) test_that("intersect with gap", { + skip_on_cran() + cdm_local <- omock::mockCdmReference() |> omock::mockPerson(n = 1) cdm_local <- omopgenerics::insertTable( @@ -195,6 +201,8 @@ test_that("intersect with gap", { }) test_that("keepOriginalCohorts", { + skip_on_cran() + cdm_local <- omock::mockCdmReference() |> omock::mockPerson(n = 2) cdm_local <- omopgenerics::insertTable( @@ -274,6 +282,8 @@ test_that("keepOriginalCohorts", { }) test_that("returnNonOverlappingCohorts - two cohorts", { + skip_on_cran() + cdm_local <- omock::mockCdmReference() |> omock::mockPerson(n = 2) cdm_local <- omopgenerics::insertTable( @@ -323,6 +333,8 @@ test_that("returnNonOverlappingCohorts - two cohorts", { }) test_that("returnNonOverlappingCohorts - three cohorts", { + skip_on_cran() + cdm_local <- omock::mockCdmReference() |> omock::mockPerson(n = 2) cdm_local <- omopgenerics::insertTable( @@ -532,6 +544,8 @@ test_that("codelist", { }) test_that("records combined for gap must be in the same observation period", { + skip_on_cran() + cdm_local <- omock::mockCdmReference() |> omock::mockPerson(n = 2) cdm_local <- omopgenerics::insertTable( @@ -586,6 +600,8 @@ test_that("records combined for gap must be in the same observation period", { }) test_that("multiple observation periods", { + skip_on_cran() + cdm_local <- omock::mockCdmReference() |> omock::mockPerson(n = 4, seed = 1) cdm_local$observation_period <- dplyr::tibble( diff --git a/tests/testthat/test-matchCohorts.R b/tests/testthat/test-matchCohorts.R index a33cdbcb..7d690950 100644 --- a/tests/testthat/test-matchCohorts.R +++ b/tests/testthat/test-matchCohorts.R @@ -77,6 +77,8 @@ test_that("matchCohorts runs without errors", { }) test_that("matchCohorts, no duplicated people within a cohort", { + skip_on_cran() + cdm <- mockCohortConstructor(nPerson = 1000) cdm$cohort1 <- cdm$cohort1 |> dplyr::group_by(subject_id) |> @@ -120,6 +122,7 @@ test_that("matchCohorts, no duplicated people within a cohort", { }) test_that("check that we obtain expected result when ratio is 1", { + skip_on_cran() cdm <- mockCohortConstructor(nPerson = 1000) @@ -179,6 +182,7 @@ test_that("check that we obtain expected result when ratio is 1", { }) test_that("test exactMatchingCohort with a ratio bigger than 1", { + skip_on_cran() cdm <- omock::emptyCdmReference(cdmName = "mock") cdm$person <- cdm$person |> @@ -278,6 +282,8 @@ test_that("test exactMatchingCohort with a ratio bigger than 1", { }) test_that("keepOriginalCohorts works" , { + skip_on_cran() + cdm <- mockCohortConstructor() cohort <- cdm$cohort2 |> matchCohorts(cohortId = 1, keepOriginalCohorts = TRUE, name = "new_cohort") expect_identical(settings(cohort), dplyr::tibble( diff --git a/tests/testthat/test-measurementCohort.R b/tests/testthat/test-measurementCohort.R index 2b01e28e..fb75091c 100644 --- a/tests/testthat/test-measurementCohort.R +++ b/tests/testthat/test-measurementCohort.R @@ -1,4 +1,6 @@ test_that("mearurementCohorts works", { + skip_on_cran() + cdm <- mockCohortConstructor(con = NULL, seed = 1) cdm$concept <- cdm$concept |> dplyr::union_all( diff --git a/tests/testthat/test-padCohortDate.R b/tests/testthat/test-padCohortDate.R index 9d32be84..79c1217c 100644 --- a/tests/testthat/test-padCohortDate.R +++ b/tests/testthat/test-padCohortDate.R @@ -1,4 +1,5 @@ test_that("simple example", { + skip_on_cran() cdm <- omock::mockCdmFromTables(tables = list( cohort = @@ -53,6 +54,7 @@ test_that("simple example", { }) test_that("overlapping entries", { + skip_on_cran() cdm <- omock::mockCdmFromTables(tables = list( cohort = @@ -162,6 +164,8 @@ test_that("test indexes - postgres", { }) test_that("adding days to cohort start", { + skip_on_cran() + cdm <- omock::mockCdmFromTables(tables = list( cohort = data.frame( @@ -348,6 +352,8 @@ test_that("test indexes - postgres", { }) test_that("test padCohortDate", { + skip_on_cran() + cdm <- omock::mockCdmFromTables(tables = list( cohort = dplyr::tibble( cohort_definition_id = 1L, diff --git a/tests/testthat/test-unionCohorts.R b/tests/testthat/test-unionCohorts.R index fbb2c8e7..a5f456f8 100644 --- a/tests/testthat/test-unionCohorts.R +++ b/tests/testthat/test-unionCohorts.R @@ -72,6 +72,8 @@ test_that("unionCohorts works", { }) test_that("gap and name works", { + skip_on_cran() + cdm_local <- omock::mockCdmReference() |> omock::mockPerson(n = 4, seed = 1) |> omock::mockObservationPeriod(seed = 1) |> @@ -277,6 +279,8 @@ test_that("test codelist", { }) test_that("keep original cohorts", { + skip_on_cran() + cdm_local <- omock::mockCdmReference() |> omock::mockPerson(n = 4, seed = 1) |> omock::mockObservationPeriod(seed = 1) |> @@ -299,6 +303,8 @@ test_that("keep original cohorts", { }) test_that("multiple observation periods", { + skip_on_cran() + cdm_local <- omock::mockCdmReference() |> omock::mockPerson(n = 4, seed = 1) cdm_local$observation_period <- dplyr::tibble(