Skip to content

Commit

Permalink
Merge pull request #358 from poissonconsulting/dev
Browse files Browse the repository at this point in the history
test gompertz failure
  • Loading branch information
joethorley committed Mar 21, 2024
2 parents 32520eb + d2f325f commit d4b56db
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/testthat/_snaps/zzz-unstable.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,26 @@
[1] -669.3178

# sgompertz cant even fit some values

Code
ssdtools:::sgompertz(data.frame(left = x, right = x))
Condition
Error in `lm.fit()`:
! NA/NaN/Inf in 'y'
Code
ssdtools:::sgompertz(data.frame(left = rep(x, 10), right = rep(x, 10)))
Condition
Error in `lm.fit()`:
! NA/NaN/Inf in 'y'
Code
ssdtools:::sgompertz(data.frame(left = x, right = x), pars = c(12800, 1))
Condition
Error in `checkwz()`:
! NAs found in the working weights variable 'wz'
Code
ssdtools:::sgompertz(data.frame(left = x / 12800, right = x / 12800))
Condition
Error in `checkwz()`:
! Some elements in the working weights variable 'wz' are not finite

13 changes: 13 additions & 0 deletions tests/testthat/test-zzz-unstable.R
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,19 @@ test_that("sgompertz with initial values still unstable!", {
expect_error(ssdtools:::sgompertz(sdata))
})

test_that("sgompertz cant even fit some values", {
skip_on_ci() # as incredibly unstable
skip_on_cran()
x <- c(160, 800, 840, 1500, 8200, 12800, 22000, 38000, 60900, 63000)
expect_snapshot({
ssdtools:::sgompertz(data.frame(left = x, right = x))
ssdtools:::sgompertz(data.frame(left = rep(x,10), right = rep(x,10)))
ssdtools:::sgompertz(data.frame(left = x, right = x), pars = c(12800, 1))
ssdtools:::sgompertz(data.frame(left = x / 12800, right = x / 12800))
},
error = TRUE)
})

test_that("ssd_hc cis with error", {
skip_on_ci()
skip_on_cran()
Expand Down

0 comments on commit d4b56db

Please sign in to comment.