Skip to content

Commit

Permalink
More coverage: plot_RLum.Results() and calc_FiniteMixture() + houseke…
Browse files Browse the repository at this point in the history
…eping
  • Loading branch information
RLumSK committed Dec 26, 2024
1 parent 2a062dc commit e887b65
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
7 changes: 3 additions & 4 deletions R/plot_RLum.Results.R
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ plot_RLum.Results<- function(
poly.border<- FALSE
}
if(pdf.colors == "none") {
col.n<- NULL
col.n <- rgb(0,0,0,0)
poly.border<- TRUE
}

Expand Down Expand Up @@ -1028,10 +1028,9 @@ plot_RLum.Results<- function(
##get data
df <- get_RLum(object = object, data.object = "dose.rate")

##reduce the size for plotting, more than 100 points makes no sense
if(nrow(df)>100) {
##reduce the size for plotting, more than 100 points make no sense
if(nrow(df)>100)
df <- df[seq(1,nrow(df), length = 100),]
}

##plot settings
plot.settings <- list(
Expand Down
14 changes: 14 additions & 0 deletions tests/testthat/test_calc_FiniteMixture.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,19 @@ test_that("check class and length of output", {
n.components = 3,
verbose = TRUE),
"The model produced NA values: either the input data are inapplicable")

})

## plot with plot_RLum.Results
t <- expect_s4_class(calc_FiniteMixture(
ExampleData.DeValues$CA1,
sigmab = 0.2,
n.components = 2:3,
grain.probability = FALSE,
trace = FALSE,
plot = FALSE,
main = "Plot title",
verbose = FALSE), "RLum.Results")
plot_RLum.Results(t, pdf.colors = "none")

})
10 changes: 10 additions & 0 deletions tests/testthat/test_calc_SourceDoseRate.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ test_that("General tests", {
predict = 10
))

## produce more than 100 rows
t <- expect_silent(calc_SourceDoseRate(
measurement.date = "2018-01-02",
calib.date = "2014-12-19",
calib.dose.rate = 0.0438,
calib.error = 0.0019,
predict = 150
))
expect_silent(plot_RLum.Results(t))

##Gy/min as unit
expect_silent(calc_SourceDoseRate(
measurement.date = "2018-01-02",
Expand Down

0 comments on commit e887b65

Please sign in to comment.