Skip to content

Commit

Permalink
Further fixes to get it operational.
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed May 23, 2024
1 parent a345f4d commit 6721695
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion R/storeDelayedObject.R
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ chihaya_array_registry[["sparse matrix"]] <- function(handle, version, ...) {
for (i in seq_along(svt)) {
idx <- indptr[i] + seq_len(indptr[i+1] - indptr[i])
if (length(idx)) {
svt[[i]] <- list(indices[idx], data[idx])
# As of version >= 1, data is first and indices are second.
svt[[i]] <- list(data[idx], indices[idx])
}
}

Expand Down
3 changes: 2 additions & 1 deletion tests/testthat/test-storeDelayedObject.R
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ test_that("sparse matrix saving handles dimnames", {

temp <- saveDelayed(DelayedArray(X))
roundtrip <- loadDelayed(temp)
expect_identical(as(X, "SVT_SparseMatrix"), roundtrip@seed)
expect_identical(type(X), type(roundtrip@seed))
expect_identical(X, as(roundtrip@seed, "dgCMatrix"))
})

test_that("sparse matrices are saved to external arrays if requested", {
Expand Down

0 comments on commit 6721695

Please sign in to comment.