Skip to content

Commit

Permalink
Update DenseNDArray with new SOMAContext
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenv committed Feb 23, 2024
1 parent a1c9a52 commit a185f8a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
11 changes: 6 additions & 5 deletions apis/python/src/tiledbsoma/_dense_nd_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,11 @@ def read(
data_shape = tuple(slot[1] + 1 for slot in ned)
target_shape = dense_indices_to_shape(coords, data_shape, result_order)

config = handle.config().copy()
config.update(platform_config or {})
context = handle.context()
if platform_config is not None:
config = context.tiledb_config.copy()
config.update(platform_config or {})
context = clib.SOMAContext(config)

ts = None
if handle.timestamp is not None:
Expand All @@ -142,14 +145,12 @@ def read(
sr = clib.SOMADenseNDArray.open(
uri=handle.uri,
mode=clib.OpenMode.read,
platform_config=config,
context=context,
column_names=[],
result_order=_util.to_clib_result_order(result_order),
timestamp=ts,
)

# sr = self._soma_reader(result_order=result_order)

self._set_reader_coords(sr, coords)

arrow_tables = []
Expand Down
4 changes: 3 additions & 1 deletion apis/python/src/tiledbsoma/_tdb_handles.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,13 @@ def open(

if open_mode == clib.OpenMode.read and obj_type == "SOMADataFrame":
return DataFrameWrapper._from_soma_object(soma_object, context)
elif open_mode == clib.OpenMode.read and obj_type == "SOMADenseNDArray":
return DenseNDArrayWrapper._from_soma_object(soma_object, context)

if obj_type in (
"SOMADataFrame",
"SOMASparseNDArray",
"SOMADenseNDArray",
"SOMASparseNDArray",
"array",
):
return ArrayWrapper.open(uri, mode, context, timestamp)
Expand Down
2 changes: 1 addition & 1 deletion apis/python/src/tiledbsoma/soma_dense_ndarray.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void load_soma_dense_ndarray(py::module &m) {
std::optional<std::pair<uint64_t, uint64_t>>>(&SOMADenseNDArray::open),
"uri"_a,
"mode"_a,
"ctx"_a,
"context"_a,
py::kw_only(),
"column_names"_a = py::none(),
"result_order"_a = ResultOrder::automatic,
Expand Down

0 comments on commit a185f8a

Please sign in to comment.