Skip to content

Commit

Permalink
analyse_pIRIRSequence():
Browse files Browse the repository at this point in the history
+ fx minor regression issue with the plot warning
+ ad tests
  • Loading branch information
RLumSK authored and mcol committed Nov 15, 2024
1 parent de06d06 commit 4a75bb4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
4 changes: 2 additions & 2 deletions R/analyse_pIRIRSequence.R
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,10 @@ analyse_pIRIRSequence <- function(

## CHECK FOR PLOT ...we safe users the pain by checking whether plot device has the
## required size.
if (plot[1] && plot.single && all(grDevices::dev.size("in") < 20)) {
if (plot[1] && !plot.single && all(grDevices::dev.size("in") < 18)) {
plot <- FALSE
.throw_warning("Argument 'plot' reset to 'FALSE'. The smallest plot ",
"size required is 20 x 20 in.\n",
"size required is 18 x 18 in.\n",
"Consider plotting via `pdf(..., height = 20, width = 20)` ",
"or setting `plot.single = FALSE`")
}
Expand Down
16 changes: 15 additions & 1 deletion tests/testthat/test_analyse_pIRIRSequence.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,24 @@ test_that("check plot stuff", {
sequence.structure = c("TL", "pseudoIRSL1", "pseudoIRSL2"),
main = "Pseudo pIRIR data set based on quartz OSL",
plot = TRUE,
plot.single = TRUE,
plot.single = FALSE,
verbose = FALSE),
"[analyse_pIRIRSequence()] Argument 'plot' reset to 'FALSE'",
fixed = TRUE)

## here it should not throw any warning because we used plot.single = TRUE
expect_silent(analyse_pIRIRSequence(
object,
signal.integral.min = 1,
signal.integral.max = 2,
background.integral.min = 900,
background.integral.max = 1000,
fit.method = "EXP",
sequence.structure = c("TL", "pseudoIRSL1", "pseudoIRSL2"),
main = "Pseudo pIRIR data set based on quartz OSL",
plot = TRUE,
plot.single = TRUE,
verbose = FALSE))
})

test_that("input validation", {
Expand Down

0 comments on commit 4a75bb4

Please sign in to comment.