Skip to content

Commit

Permalink
Tidy up code
Browse files Browse the repository at this point in the history
Edit two comments and delete code that is no longer needed.
  • Loading branch information
aphalo committed Nov 30, 2024
1 parent 0d22ecd commit 4a9b0c0
Show file tree
Hide file tree
Showing 21 changed files with 140 additions and 148 deletions.
6 changes: 1 addition & 5 deletions R/autoplot-filter-spct.r
Original file line number Diff line number Diff line change
Expand Up @@ -1252,11 +1252,7 @@ autoplot.filter_spct <-
default = c("boxes", "labels", "summaries", "colour.guide", "peaks"))
annotations <- decode_annotations(annotations,
annotations.default)
# avoid warning in 'photobiology' (== 0.10.10)
if (is.character(norm) && norm == "update" && !is_normalized(object)) {
norm <- "skip"
}
# normalization needs to be redone if unit.out has changed
# normalization updated and quantity changed in one go
object <- photobiology::normalize(x = object,
range = range,
norm = norm,
Expand Down
2 changes: 1 addition & 1 deletion R/autoplot-response-spct.r
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ autoplot.response_spct <-
if (is.character(norm) && norm == "update" && !is_normalized(object)) {
norm <- "skip"
}
# normalization needs to be redone if unit.out has changed
# normalization updated and base of expression changed in one go
object <- photobiology::normalize(x = object,
range = range,
norm = norm,
Expand Down
8 changes: 2 additions & 6 deletions R/autoplot-source-spct.r
Original file line number Diff line number Diff line change
Expand Up @@ -766,11 +766,7 @@ autoplot.source_spct <-
default = c("boxes", "labels", "summaries", "colour.guide", "peaks"))
annotations <- decode_annotations(annotations,
annotations.default)
# avoid warning in 'photobiology' (== 0.10.10)
if (is.character(norm) && norm == "update" && !is_normalized(object)) {
norm <- "skip"
}
# normalization needs to be redone if unit.out has changed
# normalization updated and base of expression changed in one go
object <- normalize(x = object,
range = range,
norm = norm,
Expand Down Expand Up @@ -878,7 +874,7 @@ autoplot.source_mspct <-
use.hinges = TRUE,
fill = NULL)
}
# We apply the normalization to the collection if it is to be bound
# We apply the normalization and change of unit to the collection if it is to be bound
# otherwise normalization is applied to the "parallel-summary" spectrum
if (plot.data == "as.is") {
object <- photobiology::normalize(object,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 13 additions & 13 deletions tests/testthat/_snaps/stats-label-peaks/stat-label-peaks-sun.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 13 additions & 13 deletions tests/testthat/_snaps/stats-label-peaks/stat-label-peaks.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 4a9b0c0

Please sign in to comment.