Skip to content

Commit

Permalink
relaxed regexes for test-tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
danielturek committed Jun 14, 2024
1 parent 8459004 commit dee7318
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions nimbleHMC/tests/testthat/test-tuning.R
Original file line number Diff line number Diff line change
Expand Up @@ -466,10 +466,10 @@ test_that('burnin/warmup are handled correctly', {
Cmcmc <- compileNimble(Rmcmc, project = Rmodel)

expect_output(out <- runMCMC(Cmcmc, nburnin = 200, niter = 1000),
regex = "using 200 warmup iterations.*all samples returned will be post-warmup")
regex = "using 200.*all samples returned will be post-warmup")

expect_output(out <- runMCMC(Cmcmc, niter = 1000),
regex = "using 500 warmup iterations.*so the first half of the samples returned.*are from the warmup period")
regex = "using 500.*so the first half of the samples returned.*are from the warmup period")

## 'burnin'
Rmodel <- nimbleModel(code, constants, data, inits, buildDerivs = TRUE)
Expand All @@ -482,7 +482,7 @@ test_that('burnin/warmup are handled correctly', {
Cmcmc <- compileNimble(Rmcmc, project = Rmodel)

expect_output(out <- runMCMC(Cmcmc, niter = 1000),
regex = "using 0 warmup iterations.*No adaptation is being done")
regex = "using 0.*No adaptation is being done")

Rmodel <- nimbleModel(code, constants, data, inits, buildDerivs = TRUE)
Cmodel <- compileNimble(Rmodel)
Expand All @@ -494,7 +494,7 @@ test_that('burnin/warmup are handled correctly', {
Cmcmc <- compileNimble(Rmcmc, project = Rmodel)

expect_output(out <- runMCMC(Cmcmc, nburnin = 200, niter = 1000),
regex = "using 200 warmup iterations.*all samples returned will be post-warmup")
regex = "using 200.*all samples returned will be post-warmup")

## 'fraction'
Rmodel <- nimbleModel(code, constants, data, inits, buildDerivs = TRUE)
Expand All @@ -507,7 +507,7 @@ test_that('burnin/warmup are handled correctly', {
Cmcmc <- compileNimble(Rmcmc, project = Rmodel)

expect_output(out <- runMCMC(Cmcmc, niter = 1000),
regex = "using 250 warmup iterations.*some of the samples returned will be collected during the warmup period")
regex = "using 250.*some of the samples returned will be collected during the warmup period")

Rmodel <- nimbleModel(code, constants, data, inits, buildDerivs = TRUE)
Cmodel <- compileNimble(Rmodel)
Expand All @@ -519,7 +519,7 @@ test_that('burnin/warmup are handled correctly', {
Cmcmc <- compileNimble(Rmcmc, project = Rmodel)

expect_output(out <- runMCMC(Cmcmc, nburnin = 100, niter = 1000),
regex = "using 250 warmup iterations.*some of the samples returned will be collected during the warmup period")
regex = "using 250.*some of the samples returned will be collected during the warmup period")

Rmodel <- nimbleModel(code, constants, data, inits, buildDerivs = TRUE)
Cmodel <- compileNimble(Rmodel)
Expand All @@ -531,7 +531,7 @@ test_that('burnin/warmup are handled correctly', {
Cmcmc <- compileNimble(Rmcmc, project = Rmodel)

expect_output(out <- runMCMC(Cmcmc, nburnin = 250, niter = 1000),
regex = "using 250 warmup iterations.*all samples returned will be post-warmup")
regex = "using 250.*all samples returned will be post-warmup")

## 'iterations'
Rmodel <- nimbleModel(code, constants, data, inits, buildDerivs = TRUE)
Expand All @@ -544,7 +544,7 @@ test_that('burnin/warmup are handled correctly', {
Cmcmc <- compileNimble(Rmcmc, project = Rmodel)

expect_output(out <- runMCMC(Cmcmc, niter = 1000),
regex = "using 500 warmup iterations.*some of the samples returned will be collected during the warmup period")
regex = "using 500.*some of the samples returned will be collected during the warmup period")

Rmodel <- nimbleModel(code, constants, data, inits, buildDerivs = TRUE)
Cmodel <- compileNimble(Rmodel)
Expand All @@ -556,7 +556,7 @@ test_that('burnin/warmup are handled correctly', {
Cmcmc <- compileNimble(Rmcmc, project = Rmodel)

expect_output(out <- runMCMC(Cmcmc, nburnin = 500, niter = 1000),
regex = "using 500 warmup iterations.*all samples returned will be post-warmup")
regex = "using 500.*all samples returned will be post-warmup")

## no adaptation
Rmodel <- nimbleModel(code, constants, data, inits, buildDerivs = TRUE)
Expand Down

0 comments on commit dee7318

Please sign in to comment.