Skip to content

Commit

Permalink
With updated ctor for SOMAArray
Browse files Browse the repository at this point in the history
  • Loading branch information
eddelbuettel committed Aug 18, 2023
1 parent ffb5673 commit 21fee2e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion apis/r/src/rinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Rcpp::List soma_array_reader(const std::string& uri,
auto sr = tdbs::SOMAArray::open(OpenMode::read,
uri,
"unnamed", // name parameter could be added
platform_config, // to add, done in iterated reader
platform_config,
column_names,
batch_size,
tdb_result_order);
Expand Down
11 changes: 2 additions & 9 deletions apis/r/src/riterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,10 @@ Rcpp::XPtr<tdbs::SOMAArray> sr_setup(const std::string& uri,

std::string_view name = "unnamed";
std::vector<std::string> column_names = {};

std::shared_ptr<tiledb::Context> ctxptr = nullptr;

std::map<std::string, std::string> platform_config = config_vector_to_map(Rcpp::wrap(config));
tiledb::Config cfg(platform_config);
spdl::debug("[sr_setup] Creating ctx object with supplied config");
ctxptr = std::make_shared<tiledb::Context>(cfg);

if (!colnames.isNull()) {
column_names = Rcpp::as<std::vector<std::string>>(colnames);
}
std::map<std::string, std::string> platform_config = config_vector_to_map(Rcpp::wrap(config));

std::uint64_t ts_start = 0; // beginning of time aka the epoch (force double signature)
std::uint64_t ts_end = std::numeric_limits<uint64_t>::max(); // max if unset
Expand All @@ -109,7 +102,7 @@ Rcpp::XPtr<tdbs::SOMAArray> sr_setup(const std::string& uri,

auto tdb_result_order = get_tdb_result_order(result_order);

auto ptr = new tdbs::SOMAArray(OpenMode::read, uri, name, ctxptr, column_names, batch_size,
auto ptr = new tdbs::SOMAArray(OpenMode::read, uri, name, platform_config, column_names, batch_size,
tdb_result_order, std::make_pair(ts_start, ts_end));

std::unordered_map<std::string, std::shared_ptr<tiledb::Dimension>> name2dim;
Expand Down

0 comments on commit 21fee2e

Please sign in to comment.