Skip to content

Commit

Permalink
fix: issue in setBackend eventually skipping chunk processing
Browse files Browse the repository at this point in the history
- Fix an issue in `setBackend` that can cause chunk-wise processing to be not
  enabled/used.
  • Loading branch information
jorainer committed Dec 6, 2023
1 parent 64bd08c commit 9732eb2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: Spectra
Title: Spectra Infrastructure for Mass Spectrometry Data
Version: 1.13.2
Version: 1.13.3
Description: The Spectra package defines an efficient infrastructure
for storing and handling mass spectrometry spectra and functionality to
subset, process, visualize and compare spectra data. It provides different
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Spectra 1.13

## Changes in 1.13.3

- Fix issue in `setBackend` that might cause chunk-wise processing to be not
run.

## Changes in 1.13.2

- Add possibility to enable and perform chunk-wise (parallel) processing to
Expand Down
4 changes: 2 additions & 2 deletions R/Spectra.R
Original file line number Diff line number Diff line change
Expand Up @@ -1551,7 +1551,7 @@ setMethod(
"setBackend", c("Spectra", "MsBackend"),
function(object, backend, f = processingChunkFactor(object), ...,
BPPARAM = bpparam()) {
backend_class <- class(object@backend)
backend_class <- class(object@backend)[1L]
BPPARAM <- backendBpparam(object@backend, BPPARAM)
BPPARAM <- backendBpparam(backend, BPPARAM)
if (!supportsSetBackend(backend))
Expand All @@ -1562,7 +1562,7 @@ setMethod(
} else {
if (!is.factor(f))
f <- force(factor(f, levels = unique(f)))
if (length(f) && length(levels(f) > 1)) {
if (length(f) && (length(levels(f)) > 1)) {
if (length(f) != length(object))
stop("length of 'f' has to match the length of 'object'")
bknds <- bplapply(
Expand Down

0 comments on commit 9732eb2

Please sign in to comment.