Skip to content

Commit

Permalink
[r] Small tweaks and polishes
Browse files Browse the repository at this point in the history
  • Loading branch information
eddelbuettel committed Sep 6, 2023
1 parent 455182e commit ed40f3b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 22 deletions.
8 changes: 2 additions & 6 deletions apis/r/R/ReadIter.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ ReadIter <- R6::R6Class(

#' @description Create (lifecycle: experimental)
#' @param sr soma read pointer
#' @param enums An optional list with enumeration information
initialize = function(sr, enumlst=NULL) {
initialize = function(sr) {
private$soma_reader_pointer <- sr
private$enums <- enumlst
},

#' @description Check if iterated read is complete or not. (lifecycle: experimental)
Expand Down Expand Up @@ -56,13 +54,11 @@ ReadIter <- R6::R6Class(

# Internal 'external pointer' object used for iterated reads
soma_reader_pointer = NULL,
#ctx_pointer = NULL,

# to be refined in derived classes
soma_reader_transform = function(x) {
.NotYetImplemented()
},
}

enums = NULL
)
)
15 changes: 1 addition & 14 deletions apis/r/R/SOMADataFrame.R
Original file line number Diff line number Diff line change
Expand Up @@ -221,20 +221,7 @@ SOMADataFrame <- R6::R6Class(
timestamp_end = private$tiledb_timestamp,
loglevel = log_level)
private$ctx_ptr <- rl$ctx

arr <- tiledb::tiledb_array(self$uri)
enumvec <- tiledb::tiledb_array_has_enumeration(arr)
enumlst <- vector(mode="list", length=length(enumvec))
names(enumlst) <- names(enumvec)
attrs <- tiledb::attrs(tiledb::schema(arr))
arr <- tiledb::tiledb_array_open(arr, "READ")
for (n in names(enumvec)) {
if (enumvec[[n]]) {
enumlst[[n]] <- tiledb::tiledb_attribute_get_enumeration(attr=attrs[[n]], arr)
}
}

TableReadIter$new(rl$sr, enumlst)
TableReadIter$new(rl$sr)
},

#' @description Update (lifecycle: experimental)
Expand Down
2 changes: 0 additions & 2 deletions apis/r/man/ReadIter.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ed40f3b

Please sign in to comment.