Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: tiledb
Type: Package
Version: 0.32.0.7
Version: 0.32.0.8
Title: Modern Database Engine for Complex Data Based on Multi-Dimensional Arrays
Authors@R: c(
person("TileDB, Inc.", role = c("aut", "cph")),
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

* `tiledb_group_open()` now respects and defaults to the first option in `type` argument (@cgiachalis in [#838](https://github.com/TileDB-Inc/TileDB-R/issues/838))

* `tiledb_config_unset()` now correctly returns the modified configuration object (@cgiachalis in [#841](https://github.com/TileDB-Inc/TileDB-R/issues/841))

## Documentation

* The package documentation website was updated (@cgiachalis in [#822](https://github.com/TileDB-Inc/TileDB-R/pull/822), [#826](https://github.com/TileDB-Inc/TileDB-R/pull/826))
Expand Down
46 changes: 25 additions & 21 deletions R/Config.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT License
#
# Copyright (c) 2017-2023 TileDB Inc.
# Copyright (c) 2017-2025 TileDB Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -34,7 +34,7 @@ tiledb_config.from_ptr <- function(ptr) {
new("tiledb_config", ptr = ptr)
}

#' Creates a `tiledb_config` object
#' Creates a TileDB Config object
#'
#' Note that for actually setting persistent values, the (altered) config
#' object needs to used to create (or update) the \code{tiledb_ctx} object. Similarly,
Expand Down Expand Up @@ -70,12 +70,13 @@ tiledb_config <- function(config = NA_character_) {

#' Gets a config parameter value
#'
#' @param x `tiledb_config` object
#' @param x A `tiledb_config` object
#' @param i parameter key string
#' @param j parameter key string, currently unused.
#' @param ... Extra parameter for method signature, currently unused.
#' @param drop Optional logical switch to drop dimensions, default FALSE, currently unused.
#' @return a config string value if parameter exists, else NA
#' @return A config string value if parameter exists, else NA
#'
#' @examples
#' \dontshow{
#' ctx <- tiledb_ctx(limitTileDBCores())
Expand All @@ -97,11 +98,11 @@ setMethod("[", "tiledb_config", function(x, i, j, ..., drop = FALSE) {

#' Sets a config parameter value
#'
#' @param x `tiledb_config` object
#' @param x A `tiledb_config` object
#' @param i parameter key string
#' @param j parameter key string
#' @param value value to set, will be converted into a stringa
#' @return updated `tiledb_config` object
#' @return The updated `tiledb_config` object
#' @examples
#' \dontshow{
#' ctx <- tiledb_ctx(limitTileDBCores())
Expand Down Expand Up @@ -134,7 +135,7 @@ setMethod("[<-", "tiledb_config", function(x, i, j, value) {

#' Prints the config object to STDOUT
#'
#' @param object `tiledb_config` object
#' @param object A `tiledb_config` object
#' @examples
#' \dontshow{
#' ctx <- tiledb_ctx(limitTileDBCores())
Expand All @@ -146,9 +147,9 @@ setMethod("show", signature(object = "tiledb_config"), function(object) {
libtiledb_config_dump(object@ptr)
})

#' Save a `tiledb_config` object ot a local text file
#' Save a TileDB Config object to a local text file
#'
#' @param config The `tiledb_config` object
#' @param config A `tiledb_config` object
#' @param path The path to config file to be created
#' @return path to created config file
#' @examples
Expand All @@ -170,9 +171,9 @@ tiledb_config_save <- function(config, path) {
libtiledb_config_save_to_file(config@ptr, path)
}

#' Load a saved `tiledb_config` file from disk
#' Load a saved TileDB Config file from disk
#'
#' @param path path to the config file
#' @param path The path to the config file to be loaded
#' @examples
#' \dontshow{
#' ctx <- tiledb_ctx(limitTileDBCores())
Expand All @@ -190,11 +191,12 @@ tiledb_config_load <- function(path) {
tiledb_config.from_ptr(ptr)
}

#' Convert a `tiledb_config` object to a R vector
#' Convert a TileDB Config object to a R vector
#'
#' @param x A `tiledb_config` object
#' @param mode A character value `"any"`, currently unused
#'
#' @param x `tiledb_config` object
#' @param mode Character value `"any"`, currently unused
#' @return a character vector of config parameter names, values
#' @return A character vector of config parameter names, values
#' @examples
#' \dontshow{
#' ctx <- tiledb_ctx(limitTileDBCores())
Expand All @@ -208,8 +210,9 @@ as.vector.tiledb_config <- function(x, mode = "any") {
libtiledb_config_vector(x@ptr)
}

#' Convert a `tiledb_config` object to a R data.frame
#' @param x `tiledb_config` object
#' Convert a TileDB Config object to `data.frame`
#'
#' @param x A `tiledb_config` object
#' @param ... Extra parameter for method signature, currently unused.
#' @return a data.frame wth parameter, value columns
#' @examples
Expand All @@ -230,7 +233,7 @@ as.data.frame.tiledb_config <- function(x, ...) {
#' By default, TileDB will use all available cores on a given machine. In multi-user or
#' multi-process settings, one may want to reduce the number of core. This function will
#' take a given number, or default to smaller of the \sQuote{Ncpus} options value or the
#' \sQuote{"OMP_THREAD_LIMIT"} enviroment variable (or two as hard fallback).
#' \sQuote{"OMP_THREAD_LIMIT"} environment variable (or two as hard fallback).
#'
#' As this function returns a config object, its intended use is as argument to the context
#' creating functions: \code{ctx <- tiledb_ctx(limitTileDBCores())}. To check that the values
Expand Down Expand Up @@ -263,16 +266,17 @@ limitTileDBCores <- function(ncores, verbose = FALSE) {

#' Unset a TileDB Config parameter to its default value
#'
#' @param config A TileDB Config object
#' @param config A `tiledb_config` object
#' @param param A character variable with the parameter name
#' @return The modified TileDB Config object
#' @return The modified `tiledb_config` object
#' @export
tiledb_config_unset <- function(config, param) {
stopifnot(
`The 'config' argument must be a tiledb_config object` = is(config, "tiledb_config"),
`The 'param' argument must be of type character` = is.character(param)
)
libtiledb_config_unset(config@ptr, param)
ptr <- libtiledb_config_unset(config@ptr, param)
tiledb_config.from_ptr(ptr)
}

#' Display the 'AsBuilt' JSON string
Expand Down
11 changes: 11 additions & 0 deletions inst/tinytest/test_config.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ expect_equal(tiledb:::libtiledb_config_get(cfg@ptr, param)[[1]], newval)

tiledb:::libtiledb_config_unset(cfg@ptr, param) # resets, not unsets
expect_equal(tiledb:::libtiledb_config_get(cfg@ptr, param)[[1]], origval)

# test 'tiledb_config_unset()'
origval <- cfg["sm.group.timestamp_end"]

# new value
cfg["sm.group.timestamp_end"] <- 1000

cfg <- tiledb_config_unset(cfg, "sm.group.timestamp_end")
expect_equal(is(cfg), "tiledb_config")
expect_equal(cfg["sm.group.timestamp_end"], origval)

#})


Expand Down
6 changes: 3 additions & 3 deletions man/as.data.frame.tiledb_config.Rd

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

10 changes: 5 additions & 5 deletions man/as.vector.tiledb_config.Rd

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

2 changes: 1 addition & 1 deletion man/limitTileDBCores.Rd

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

2 changes: 1 addition & 1 deletion man/show-tiledb_config-method.Rd

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

4 changes: 2 additions & 2 deletions man/sub-tiledb_config-ANY-method.Rd

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

4 changes: 2 additions & 2 deletions man/subset-tiledb_config-ANY-ANY-ANY-method.Rd

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

2 changes: 1 addition & 1 deletion man/tiledb_config.Rd

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

6 changes: 3 additions & 3 deletions man/tiledb_config_load.Rd

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

6 changes: 3 additions & 3 deletions man/tiledb_config_save.Rd

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

4 changes: 2 additions & 2 deletions man/tiledb_config_unset.Rd

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