Skip to content

Commit

Permalink
fix space issue and set seed
Browse files Browse the repository at this point in the history
  • Loading branch information
turgeonmaxime committed Apr 9, 2024
1 parent 1bee7f2 commit 96a64b1
Show file tree
Hide file tree
Showing 16 changed files with 63 additions and 16 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
5 changes: 4 additions & 1 deletion tests/testthat/test-absRisk.R
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
5 changes: 4 additions & 1 deletion tests/testthat/test-absRiskComp.R
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
7 changes: 7 additions & 0 deletions tests/testthat/test-confint.R
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
5 changes: 4 additions & 1 deletion tests/testthat/test-fitting.R
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 4 additions & 1 deletion tests/testthat/test-fittingComp.R
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 4 additions & 1 deletion tests/testthat/test-gam.R
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
7 changes: 6 additions & 1 deletion tests/testthat/test-gbm.R
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
4 changes: 3 additions & 1 deletion tests/testthat/test-glmnet.R
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
6 changes: 4 additions & 2 deletions tests/testthat/test-matrix.R
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 4 additions & 1 deletion tests/testthat/test-plotHazard.R
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
4 changes: 3 additions & 1 deletion tests/testthat/test-plotSingleEventCB.R
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
4 changes: 3 additions & 1 deletion tests/testthat/test-plotabsRiskCB.R
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
4 changes: 3 additions & 1 deletion tests/testthat/test-popTime.R
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 3 additions & 1 deletion tests/testthat/test-sampling.R
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 96a64b1

Please sign in to comment.