Skip to content

Commit

Permalink
Merge pull request #102 from TileDB-Inc/aaronwolen/fix-group-member-c…
Browse files Browse the repository at this point in the history
…ache

Update group member cache after removing a member
  • Loading branch information
aaronwolen authored Aug 11, 2023
2 parents ff6c998 + d3f58e2 commit bc207fd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Description: Interface for working with 'TileDB'-based Stack of Matrices,
from and export to in-memory formats used by popular toolchains like
'Seurat', 'Bioconductor', and even 'AnnData' using the companion Python
package.
Version: 0.1.5.9001
Version: 0.1.5.9002
Authors@R: c(
person(given = "Aaron",
family = "Wolen",
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
- Sparse matrix conversions are now performed via virtual classes to comply with the changes noted in the Matrix 1.5.0 release notes
- A new metadata tag, `soma_legacy_validity`, is now attached to all arrays created by `SOMA` objects. By default this value is `"false"` unless the TileDB-R legacy validity mode was enabled at creation time (i.e., `r.legacy_validity_mode`). When reading arrays from disk, the `AnnotationDataFrame` class will check for this tag on initialization and when performing reads or writes. If the tag is present and set to `"true"`, legacy validity mode is enabled globally (as its not possible to set on a per-array basis). Legacy validity mode is also enabled when reading `AnnotationDataFrame` arrays that lack the tag, as this indicates the array was created with an older version of the package. These checks are limited to `AnnotationDataFrame` arrays because the incorrect validity map values only affect nullable string attributes. See TileDB-R's [release notes](https://github.com/TileDB-Inc/TileDB-R/blob/master/NEWS.md#breaking-changes) for more information.

## Fixes

- Group member cache is now updated when a member is removed (#102)

# tiledbsc 0.1.5

## Features
Expand Down
2 changes: 2 additions & 0 deletions R/TileDBGroup.R
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ TileDBGroup <- R6::R6Class(
grp = self$object,
uri = name
)
# Remove from cache
self$members[[name]] <- NULL
},

#' @description Count the number of members in the group.
Expand Down
6 changes: 6 additions & 0 deletions tests/testthat/test_TileDBGroup.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,15 @@ test_that("members can be added and retrieved from a new group", {

# remove members
grp$remove_member("a1")
expect_length(grp$members, 1)
expect_equal(grp$count_members(), 1)
grp$remove_member("g1")
expect_equal(grp$count_members(), 0)
expect_length(grp$members, 0)

# add back member with the same name
grp$add_member(a1, relative = FALSE)
expect_length(grp$members, 1)
})

test_that("group member names are retained", {
Expand Down

0 comments on commit bc207fd

Please sign in to comment.