From cc91ceedd76668d01a6d7d9ef96c67739d98e9e4 Mon Sep 17 00:00:00 2001 From: LTLA Date: Tue, 28 May 2024 23:17:12 -0700 Subject: [PATCH] Forward extract_sparse_array() call to the WrapperArraySeed's seed. --- DESCRIPTION | 4 ++-- R/WrapperArraySeed.R | 5 +++++ inst/NEWS.Rd | 2 ++ man/WrapperArraySeed.Rd | 1 + 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9ea96b3..3b441b5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: alabaster.matrix Title: Load and Save Artifacts from File -Version: 1.5.1 -Date: 2024-05-22 +Version: 1.5.2 +Date: 2024-05-28 Authors@R: person("Aaron", "Lun", role=c("aut", "cre"), email="infinite.monkeys.with.keyboards@gmail.com") License: MIT + file LICENSE Description: diff --git a/R/WrapperArraySeed.R b/R/WrapperArraySeed.R index 09c5d4e..780ff2c 100644 --- a/R/WrapperArraySeed.R +++ b/R/WrapperArraySeed.R @@ -20,6 +20,7 @@ #' path,WrapperArraySeed-method #' is_sparse,WrapperArraySeed-method #' extract_array,WrapperArraySeed-method +#' extract_sparse_array,WrapperArraySeed-method #' OLD_extract_sparse_array,WrapperArraySeed-method #' WrapperArray-class #' coerce,WrapperArray,dgCMatrix-method @@ -64,6 +65,10 @@ setMethod("is_sparse", "WrapperArraySeed", function(x) callGeneric(x@seed)) #' @importFrom DelayedArray extract_array setMethod("extract_array", "WrapperArraySeed", function(x, index) callGeneric(x@seed, index)) +#' @export +#' @importFrom SparseArray extract_sparse_array +setMethod("extract_sparse_array", "WrapperArraySeed", function(x, index) callGeneric(x@seed, index)) + #' @export #' @importFrom DelayedArray OLD_extract_sparse_array setMethod("OLD_extract_sparse_array", "WrapperArraySeed", function(x, index) callGeneric(x@seed, index)) diff --git a/inst/NEWS.Rd b/inst/NEWS.Rd index fe89a2c..ef3d549 100644 --- a/inst/NEWS.Rd +++ b/inst/NEWS.Rd @@ -5,4 +5,6 @@ \section{Version 1.6.0}{\itemize{ \item Support the SVT_SparseMatrix version 1 class definition in \code{saveObject}. However, note that this was not implemented for the soft-deprecated \code{writeSparseMatrix}, which now errors if such objects are passed in. + +\item Added a \code{extract_sparse_array()} method for the \code{WrapperArraySeed} class, for some future-proofing when the seeds eventually make the switch. }} diff --git a/man/WrapperArraySeed.Rd b/man/WrapperArraySeed.Rd index 554c064..fbd8b9b 100644 --- a/man/WrapperArraySeed.Rd +++ b/man/WrapperArraySeed.Rd @@ -10,6 +10,7 @@ \alias{path,WrapperArraySeed-method} \alias{is_sparse,WrapperArraySeed-method} \alias{extract_array,WrapperArraySeed-method} +\alias{extract_sparse_array,WrapperArraySeed-method} \alias{OLD_extract_sparse_array,WrapperArraySeed-method} \alias{WrapperArray-class} \alias{coerce,WrapperArray,dgCMatrix-method}