From db20ab5e09710de548ffee8e9157a95719a5267a Mon Sep 17 00:00:00 2001 From: John Kerl Date: Tue, 29 Oct 2024 18:04:43 -0400 Subject: [PATCH 1/2] [r] Prepare for 1.15.0rc3 --- apis/r/DESCRIPTION | 2 +- apis/r/NEWS.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apis/r/DESCRIPTION b/apis/r/DESCRIPTION index 8413700611..2b066a1146 100644 --- a/apis/r/DESCRIPTION +++ b/apis/r/DESCRIPTION @@ -6,7 +6,7 @@ Description: Interface for working with 'TileDB'-based Stack of Matrices, like those commonly used for single cell data analysis. It is documented at ; a formal specification available is at . -Version: 1.14.99.6 +Version: 1.14.99.7 Authors@R: c( person(given = "Aaron", family = "Wolen", role = c("cre", "aut"), email = "aaron@tiledb.com", diff --git a/apis/r/NEWS.md b/apis/r/NEWS.md index f477cf2913..d07a2bfeb5 100644 --- a/apis/r/NEWS.md +++ b/apis/r/NEWS.md @@ -8,6 +8,9 @@ * Implement missing `domain` argument to `SOMADataFrame` `create` [#3032](https://github.com/single-cell-data/TileDB-SOMA/pull/3032) * Remove unused `fragment_count` accessor [#3054](https://github.com/single-cell-data/TileDB-SOMA/pull/3054) * Bulk-sync `main` to `release-1.15` in prep for 1.15.0rc3 +* New-shape mods [#2407](https://github.com/single-cell-data/TileDB-SOMA/issues/2407) +* Run `clang-format` for C++ source and `styler::style_pkg()` for R source +* Fix context/config bug [#3252](https://github.com/single-cell-data/TileDB-SOMA/pull/3252) # tiledbsoma 1.14.5 From 20485c793829a15e27d01bb320bea290c561f46d Mon Sep 17 00:00:00 2001 From: John Kerl Date: Tue, 29 Oct 2024 18:08:40 -0400 Subject: [PATCH 2/2] backport #3252 --- apis/r/R/TileDBObject.R | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/apis/r/R/TileDBObject.R b/apis/r/R/TileDBObject.R index 084ecc0576..f66badf06e 100644 --- a/apis/r/R/TileDBObject.R +++ b/apis/r/R/TileDBObject.R @@ -39,12 +39,35 @@ TileDBObject <- R6::R6Class( private$.tiledb_platform_config <- platform_config # Set context - tiledbsoma_ctx <- tiledbsoma_ctx %||% SOMATileDBContext$new() - if (!inherits(x = tiledbsoma_ctx, what = "SOMATileDBContext")) { - stop("'tiledbsoma_ctx' must be a SOMATileDBContext object", call. = FALSE) + if (!is.null(x = tiledbsoma_ctx)) { + if (!inherits(x = tiledbsoma_ctx, what = 'SOMATileDBContext')) { + stop( + "'tiledbsoma_ctx' must be a SOMATileDBContext object", + call. = FALSE + ) + } + # TODO: Deprecate tiledbsoma_ctx in favor of soma_context + # warning("'tiledbsoma_ctx' is deprecated, use 'soma_context' instead") + # Set the old context + private$.tiledbsoma_ctx <- tiledbsoma_ctx + private$.tiledb_ctx <- self$tiledbsoma_ctx$context() + # Also plumb through to the new context + if (!is.null(soma_context)) { + warning( + "Both 'soma_context' and 'tiledbsoma_ctx' were provided,", + "using 'soma_context' only" + ) + } else { + # why we named the parameter and function the same thing is beyond me + soma_context <- tiledbsoma::soma_context( + config = unlist(tiledbsoma_ctx$to_list()) + ) + } + } else { + tiledbsoma_ctx <- SOMATileDBContext$new() + private$.tiledbsoma_ctx <- tiledbsoma_ctx + private$.tiledb_ctx <- self$tiledbsoma_ctx$context() } - private$.tiledbsoma_ctx <- tiledbsoma_ctx - private$.tiledb_ctx <- self$tiledbsoma_ctx$context() # TODO: re-enable once new UX is worked out # soma_context <- soma_context %||% soma_context()