Skip to content

Commit

Permalink
auto-compute function_name_for_messages
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkerl committed Oct 28, 2024
1 parent 8403c10 commit 178eae6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion apis/r/R/SOMADataFrame.R
Original file line number Diff line number Diff line change
Expand Up @@ -420,10 +420,11 @@ SOMADataFrame <- R6::R6Class(
stopifnot("'new_shape' must be an integer" = rlang::is_integerish(new_shape, n = 1) ||
(bit64::is.integer64(new_shape) && length(new_shape) == 1)
)
function_name_for_messages <- sys.call(sys.parent(n=1)[[1]]
# Checking slotwise new shape >= old shape, and <= max_shape, is already done in libtiledbsoma
invisible(
resize_soma_joinid_shape(
self$uri, new_shape, "tiledbsoma_resize_soma_joinid_shape", private$.soma_context))
self$uri, new_shape, function_name_for_messages, private$.soma_context))
}

),
Expand Down
6 changes: 4 additions & 2 deletions apis/r/R/SOMANDArrayBase.R
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@ SOMANDArrayBase <- R6::R6Class(
rlang::is_integerish(new_shape, n = self$ndim()) ||
(bit64::is.integer64(new_shape) && length(new_shape) == self$ndim())
)
function_name_for_messages <- sys.call(sys.parent(n=1)[[1]]
# Checking slotwise new shape >= old shape, and <= max_shape, is already done in libtiledbsoma
resize(self$uri, new_shape, "resize", private$.soma_context)
resize(self$uri, new_shape, function_name_for_messages, private$.soma_context)
},

#' @description Allows the array to have a resizeable shape as described in the
Expand All @@ -124,8 +125,9 @@ SOMANDArrayBase <- R6::R6Class(
rlang::is_integerish(shape, n = self$ndim()) ||
(bit64::is.integer64(shape) && length(shape) == self$ndim())
)
function_name_for_messages <- sys.call(sys.parent(n=1)[[1]]
# Checking slotwise new shape >= old shape, and <= max_shape, is already done in libtiledbsoma
tiledbsoma_upgrade_shape(self$uri, shape, "tiledbsoma_upgrade_shape", private$.soma_context)
tiledbsoma_upgrade_shape(self$uri, shape, function_name_for_messages, private$.soma_context)
}

),
Expand Down

0 comments on commit 178eae6

Please sign in to comment.