Skip to content

Commit

Permalink
Add test and update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
Bisaloo committed Jun 11, 2020
1 parent ac48dfa commit 2a4347c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

## MINOR FEATURES AND BUG FIXES

* `vismodel()` now works with spectral data that doesn't span the whole
300-700nm range as long as the spectral sensitivity is zero for the missing
range. This is useful if you have data covering the 390-700nm range and work
the CIE model for example.
* `bootcoldist()` is now laxer in its argument checks and accept objects that
are neither `vismodel` or `colspace` objects. This means you can now use this
function on quantum catches dataframe that you obtained outside of pavo, such
Expand Down
11 changes: 8 additions & 3 deletions tests/testthat/test-vismodel.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ test_that("Warnings", {

expect_silent(vismodel(flowers_NIR, sensmodel(c(350, 450, 550, 650), range = c(300, 1200))))

expect_identical(
vismodel(flowers, visual = "cie10", illum = "D65", vonkries = TRUE, relative = FALSE),
vismodel(flowers[91:401,], visual = "cie10", illum = "D65", vonkries = TRUE, relative = FALSE)
)

})

test_that("Sensmodel", {
Expand All @@ -52,13 +57,13 @@ test_that("Sensmodel", {
})

test_that("sensdata()", {

vis_all <- sensdata(visual = "all", achromatic = "all",
illum = "all", trans = "all",
bkg = "all")

# No negative values, no NA
expect_false(any(vis_all < 0))
expect_false(anyNA(vis_all))

})

0 comments on commit 2a4347c

Please sign in to comment.