Skip to content

Commit

Permalink
code-review feedback [skip ci]
Browse files Browse the repository at this point in the history
Co-authored-by: nguyenv <[email protected]>
  • Loading branch information
johnkerl and nguyenv committed Sep 4, 2024
1 parent aa02a85 commit 6dba46b
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 15 deletions.
3 changes: 2 additions & 1 deletion apis/python/src/tiledbsoma/soma_dataframe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ void load_soma_dataframe(py::module& m) {
.def_property_readonly(
"maybe_soma_joinid_shape", &SOMADataFrame::maybe_soma_joinid_shape)
.def_property_readonly(
"maybe_soma_joinid_maxshape", &SOMADataFrame::maybe_soma_joinid_maxshape)
"maybe_soma_joinid_maxshape",
&SOMADataFrame::maybe_soma_joinid_maxshape)
.def_property_readonly(
"count",
&SOMADataFrame::count,
Expand Down
5 changes: 2 additions & 3 deletions apis/python/tests/test_shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,14 @@ def test_sparse_nd_array_basics(
# TODO: make sure this doesn't come through as RuntimeError
# https://github.com/single-cell-data/TileDB-SOMA/issues/2407
with pytest.raises((RuntimeError, ValueError)):
coords = tuple([arg_shape[i] + 10 for i in range(ndim)])
coords = tuple(arg_shape[i] + 10 for i in range(ndim))
snda.read(coords).tables().concat()

# Test writes out of bounds
with tiledbsoma.SparseNDArray.open(uri, "w") as snda:
with pytest.raises(tiledbsoma.SOMAError):
dikt = {"soma_data": [30]}
for i in range(ndim):
dikt[dim_names[i]] = [arg_shape[i] + 20]
dikt = {name: [shape + 20] for name, shape in zip(dim_names, arg_shape)}
table = pa.Table.from_pydict(dikt)
snda.write(table)

Expand Down
4 changes: 2 additions & 2 deletions apis/python/tests/test_sparse_nd_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ def test_sparse_nd_array_create_ok(
# https://github.com/single-cell-data/TileDB-SOMA/issues/2407
assert isinstance(a.maxshape, tuple)
assert len(a.maxshape) == len(a.shape)
for i in range(len(a.shape)):
assert a.maxshape[i] >= a.shape[i]
for maxshape, shape in zip(a.maxshape, a.shape):
assert maxshape >= shape

assert a.is_sparse is True

Expand Down
4 changes: 2 additions & 2 deletions libtiledbsoma/src/soma/soma_array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ std::unique_ptr<SOMAArray> SOMAArray::create(
return std::make_unique<SOMAArray>(ctx, array, timestamp);
}

std::unique_ptr<SOMAArray> SOMAArray::open( // XXX TOUCH
std::unique_ptr<SOMAArray> SOMAArray::open( // XXX TOUCH
OpenMode mode,
std::string_view uri,
std::string_view name,
Expand Down Expand Up @@ -143,7 +143,7 @@ SOMAArray::SOMAArray(
fill_metadata_cache();
}

SOMAArray::SOMAArray( // XXX TOUCH
SOMAArray::SOMAArray( // XXX TOUCH
OpenMode mode,
std::string_view uri,
std::shared_ptr<SOMAContext> ctx,
Expand Down
4 changes: 2 additions & 2 deletions libtiledbsoma/src/soma/soma_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class SOMAArray : public SOMAObject {
* @param timestamp Optional pair indicating timestamp start and end
* @return std::unique_ptr<SOMAArray> SOMAArray
*/
static std::unique_ptr<SOMAArray> open( // XXX
static std::unique_ptr<SOMAArray> open( // XXX
OpenMode mode,
std::string_view uri,
std::string_view name = "unnamed",
Expand Down Expand Up @@ -157,7 +157,7 @@ class SOMAArray : public SOMAObject {
* @param result_order Result order
* @param timestamp Timestamp
*/
SOMAArray( // XXX TOUCH
SOMAArray( // XXX TOUCH
OpenMode mode,
std::string_view uri,
std::shared_ptr<SOMAContext> ctx,
Expand Down
5 changes: 2 additions & 3 deletions libtiledbsoma/src/soma/soma_dataframe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,12 @@ std::unique_ptr<SOMADataFrame> SOMADataFrame::open(
mode, uri, ctx, column_names, result_order, timestamp);
}

std::unique_ptr<SOMADataFrame> SOMADataFrame::open( // XXX TOUCH
std::unique_ptr<SOMADataFrame> SOMADataFrame::open( // XXX TOUCH
std::string_view uri,
OpenMode mode,
std::string_view name,
std::map<std::string, std::string> platform_config) {
return std::make_unique<SOMADataFrame>(
mode, uri, name, platform_config);
return std::make_unique<SOMADataFrame>(mode, uri, name, platform_config);
}

bool SOMADataFrame::exists(
Expand Down
4 changes: 2 additions & 2 deletions libtiledbsoma/src/soma/soma_dataframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class SOMADataFrame : public SOMAArray {
* @param ctx TO WRITE
* @return std::unique_ptr<SOMADataFrame> SOMADataFrame
*/
static std::unique_ptr<SOMADataFrame> open( // XXX
static std::unique_ptr<SOMADataFrame> open( // XXX
std::string_view uri,
OpenMode mode,
std::string_view name,
Expand Down Expand Up @@ -155,7 +155,7 @@ class SOMADataFrame : public SOMAArray {
* @param TO WRITE
* @param TO WRITE
*/
SOMADataFrame( // XXX
SOMADataFrame( // XXX
OpenMode mode,
std::string_view uri,
std::string_view name,
Expand Down

0 comments on commit 6dba46b

Please sign in to comment.