Skip to content

Commit

Permalink
Set lower limit to 0 (#394)
Browse files Browse the repository at this point in the history
* initial

* fixed misc test failures
  • Loading branch information
gowerc authored Aug 12, 2024
1 parent 85c1440 commit 5b50387
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions R/utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ samples_median_ci <- function(samples, level = 0.95) {
decorated_render <- function(...) {
jinjar::render(
...,
machine_double_eps = sqrt(.Machine$double.eps),
machine_double_neg_eps = sqrt(.Machine$double.neg.eps)
machine_double_eps = 0,
machine_double_neg_eps = 0
)
}

Expand Down
12 changes: 6 additions & 6 deletions tests/testthat/test-SurvivalLoglogistic.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ test_that("sim_os_loglogistic() is consistant with flexsurv", {

test_that("SurvivalLogLogistic can recover known values", {

true_a <- 400
true_b <- 2
true_a <- 300
true_b <- 3
true_beta <- c(0.5, -0.2, 0.1)
set.seed(837)

Expand All @@ -38,8 +38,8 @@ test_that("SurvivalLogLogistic can recover known values", {

jm <- JointModel(
survival = SurvivalLogLogistic(
a = prior_lognormal(log(400), 1),
b = prior_lognormal(log(2), 1)
a = prior_lognormal(log(true_a), 1),
b = prior_lognormal(log(true_b), 1)
)
)

Expand All @@ -60,8 +60,8 @@ test_that("SurvivalLogLogistic can recover known values", {
sampleStanModel(
jm,
data = jdat,
iter_warmup = 300,
iter_sampling = 400,
iter_warmup = 350,
iter_sampling = 450,
chains = 1,
refresh = 0,
parallel_chains = 1
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-jinjar_render.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ test_that("Global variables defined by `decorated_render() are usable", {
"%d hi there %s and %s",
5,
"bob",
scales::scientific(sqrt(.Machine$double.eps), digits = 5)
0
)
expect_equal(observed, expected)
})

0 comments on commit 5b50387

Please sign in to comment.