diff --git a/DESCRIPTION b/DESCRIPTION index f3ea414..4995683 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: casebase Type: Package Title: Fitting Flexible Smooth-in-Time Hazards and Risk Functions via Logistic and Multinomial Regression -Version: 0.10.4 -Date: 2024-02-01 +Version: 0.10.5 +Date: 2024-04-09 Authors@R: c(person(given = "Sahir", family = "Bhatnagar", diff --git a/NEWS.md b/NEWS.md index 3f36e0c..380082f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +# casebase 0.10.5 + +* Skip tests when R is compiled against ATLAS BLAS +* Set seed for reproducible tests + # casebase 0.10.4 * Fix bug with tangled outputs of vignettes. diff --git a/tests/testthat/test-absRisk.R b/tests/testthat/test-absRisk.R index 61467be..59f9cd3 100644 --- a/tests/testthat/test-absRisk.R +++ b/tests/testthat/test-absRisk.R @@ -1,6 +1,9 @@ context("Absolute risk") +set.seed(12345) + # CRAN skip atlas check fix -testthat::skip_if(grepl(pattern = "atlas",sessionInfo()$BLAS,ignore.case=TRUE)) +testthat::skip_if(grepl(pattern = "atlas", sessionInfo()$BLAS, + ignore.case = TRUE)) # Handling warning messages coming from montecarlo integration handler_validmc <- function(msg) { diff --git a/tests/testthat/test-absRiskComp.R b/tests/testthat/test-absRiskComp.R index 5497b75..786065d 100644 --- a/tests/testthat/test-absRiskComp.R +++ b/tests/testthat/test-absRiskComp.R @@ -1,6 +1,9 @@ context("Absolute risk-Comp risk") +set.seed(12345) + # CRAN skip atlas check fix -testthat::skip_if(grepl(pattern = "atlas",sessionInfo()$BLAS,ignore.case=TRUE)) +testthat::skip_if(grepl(pattern = "atlas", sessionInfo()$BLAS, + ignore.case = TRUE)) # Handling warning messages coming from montecarlo integration handler_validmc <- function(msg) { diff --git a/tests/testthat/test-confint.R b/tests/testthat/test-confint.R index 179f45e..0b1f225 100644 --- a/tests/testthat/test-confint.R +++ b/tests/testthat/test-confint.R @@ -1,3 +1,10 @@ +context("Confidence intervals") +set.seed(12345) + +# CRAN skip atlas check fix +testthat::skip_if(grepl(pattern = "atlas", sessionInfo()$BLAS, + ignore.case = TRUE)) + # Handling warning messages coming from montecarlo integration handler_validmc <- function(msg) { if (any(grepl("out of range", msg))) invokeRestart("muffleWarning") diff --git a/tests/testthat/test-fitting.R b/tests/testthat/test-fitting.R index 5cba579..2519b80 100644 --- a/tests/testthat/test-fitting.R +++ b/tests/testthat/test-fitting.R @@ -1,6 +1,9 @@ context("Fitting") +set.seed(12345) + # CRAN skip atlas check fix -testthat::skip_if(grepl(pattern = "atlas",sessionInfo()$BLAS,ignore.case=TRUE)) +testthat::skip_if(grepl(pattern = "atlas", sessionInfo()$BLAS, + ignore.case = TRUE)) n <- 100 diff --git a/tests/testthat/test-fittingComp.R b/tests/testthat/test-fittingComp.R index ef9f3e5..7089f15 100644 --- a/tests/testthat/test-fittingComp.R +++ b/tests/testthat/test-fittingComp.R @@ -1,6 +1,9 @@ context("Fitting-Comp risk") +set.seed(12345) + # CRAN skip atlas check fix -testthat::skip_if(grepl(pattern = "atlas",sessionInfo()$BLAS,ignore.case=TRUE)) +testthat::skip_if(grepl(pattern = "atlas", sessionInfo()$BLAS, + ignore.case = TRUE)) n <- 100 diff --git a/tests/testthat/test-gam.R b/tests/testthat/test-gam.R index e10a5ce..632071d 100644 --- a/tests/testthat/test-gam.R +++ b/tests/testthat/test-gam.R @@ -1,6 +1,9 @@ context("GAMs") +set.seed(12345) + # CRAN skip atlas check fix -testthat::skip_if(grepl(pattern = "atlas",sessionInfo()$BLAS,ignore.case=TRUE)) +testthat::skip_if(grepl(pattern = "atlas", sessionInfo()$BLAS, + ignore.case = TRUE)) # Skip tests if mgcv is not installed testthat::skip_if_not_installed("mgcv") diff --git a/tests/testthat/test-gbm.R b/tests/testthat/test-gbm.R index c79f37e..c155929 100644 --- a/tests/testthat/test-gbm.R +++ b/tests/testthat/test-gbm.R @@ -1,6 +1,11 @@ context("GBMs") +set.seed(12345) + +testthat::skip_if(TRUE, message = 'GBM is not implemented') + # CRAN skip atlas check fix -testthat::skip_if(grepl(pattern = "atlas",sessionInfo()$BLAS,ignore.case=TRUE)) +testthat::skip_if(grepl(pattern = "atlas", sessionInfo()$BLAS, + ignore.case = TRUE)) # Skip tests if gbm is not installed testthat::skip_if_not_installed("gbm") diff --git a/tests/testthat/test-glmnet.R b/tests/testthat/test-glmnet.R index 7ae4d13..c3835cc 100644 --- a/tests/testthat/test-glmnet.R +++ b/tests/testthat/test-glmnet.R @@ -1,7 +1,9 @@ context("glmnet") +set.seed(12345) # CRAN skip atlas check fix -testthat::skip_if(grepl(pattern = "atlas",sessionInfo()$BLAS,ignore.case=TRUE)) +testthat::skip_if(grepl(pattern = "atlas", sessionInfo()$BLAS, + ignore.case = TRUE)) # Skip tests if gbm is not installed testthat::skip_if_not_installed("glmnet") diff --git a/tests/testthat/test-matrix.R b/tests/testthat/test-matrix.R index f7b2227..4487939 100644 --- a/tests/testthat/test-matrix.R +++ b/tests/testthat/test-matrix.R @@ -1,7 +1,9 @@ context("Matrix interface") -# CRAN skip atlas check fix -testthat::skip_if(grepl(pattern = "atlas",sessionInfo()$BLAS,ignore.case=TRUE)) +set.seed(12345) +# CRAN skip atlas check fix +testthat::skip_if(grepl(pattern = "atlas", sessionInfo()$BLAS, + ignore.case = TRUE)) N <- 1000; p <- 30 nzc <- 0.33 * p diff --git a/tests/testthat/test-plotHazard.R b/tests/testthat/test-plotHazard.R index c212259..1d19994 100644 --- a/tests/testthat/test-plotHazard.R +++ b/tests/testthat/test-plotHazard.R @@ -1,6 +1,9 @@ context("plotHazard") +set.seed(12345) + # CRAN skip atlas check fix -testthat::skip_if(grepl(pattern = "atlas",sessionInfo()$BLAS,ignore.case=TRUE)) +testthat::skip_if(grepl(pattern = "atlas", sessionInfo()$BLAS, + ignore.case = TRUE)) skip_if_not_installed("glmnet") skip_if_not_installed("mgcv") diff --git a/tests/testthat/test-plotSingleEventCB.R b/tests/testthat/test-plotSingleEventCB.R index 536d145..8ff1b89 100644 --- a/tests/testthat/test-plotSingleEventCB.R +++ b/tests/testthat/test-plotSingleEventCB.R @@ -1,7 +1,9 @@ context("plot.singleEventCB") +set.seed(12345) # CRAN skip atlas check fix -testthat::skip_if(grepl(pattern = "atlas",sessionInfo()$BLAS,ignore.case=TRUE)) +testthat::skip_if(grepl(pattern = "atlas", sessionInfo()$BLAS, + ignore.case = TRUE)) # Uncomment next line to skip tests in non-interactive session skip_if_not_installed("glmnet") diff --git a/tests/testthat/test-plotabsRiskCB.R b/tests/testthat/test-plotabsRiskCB.R index cac2287..f874584 100644 --- a/tests/testthat/test-plotabsRiskCB.R +++ b/tests/testthat/test-plotabsRiskCB.R @@ -1,7 +1,9 @@ context("Absolute risk plotting") +set.seed(12345) # CRAN skip atlas check fix -testthat::skip_if(grepl(pattern = "atlas",sessionInfo()$BLAS,ignore.case=TRUE)) +testthat::skip_if(grepl(pattern = "atlas", sessionInfo()$BLAS, + ignore.case = TRUE)) # Handling warning messages coming from montecarlo integration handler_validmc <- function(msg) { diff --git a/tests/testthat/test-popTime.R b/tests/testthat/test-popTime.R index 590e275..b2bbe01 100644 --- a/tests/testthat/test-popTime.R +++ b/tests/testthat/test-popTime.R @@ -1,7 +1,9 @@ context("popTime methods") +set.seed(12345) # CRAN skip atlas check fix -testthat::skip_if(grepl(pattern = "atlas",sessionInfo()$BLAS,ignore.case=TRUE)) +testthat::skip_if(grepl(pattern = "atlas", sessionInfo()$BLAS, + ignore.case = TRUE)) nobs <- 500 diff --git a/tests/testthat/test-sampling.R b/tests/testthat/test-sampling.R index c8f19fc..0895c49 100644 --- a/tests/testthat/test-sampling.R +++ b/tests/testthat/test-sampling.R @@ -1,7 +1,9 @@ context("Sampling") +set.seed(12345) # CRAN skip atlas check fix -testthat::skip_if(grepl(pattern = "atlas",sessionInfo()$BLAS,ignore.case=TRUE)) +testthat::skip_if(grepl(pattern = "atlas", sessionInfo()$BLAS, + ignore.case = TRUE)) # Create simulated data with competing risks---- nobs <- 500