Skip to content

Commit

Permalink
pre-merge [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkerl committed Sep 4, 2024
1 parent 404d9f2 commit aa02a85
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 40 deletions.
8 changes: 4 additions & 4 deletions apis/python/src/tiledbsoma/_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def count(self) -> int:
return cast(DataFrameWrapper, self._handle).count

@property
def _maybe_sjid_shape(self) -> Optional[int]:
def _maybe_soma_joinid_shape(self) -> Optional[int]:
"""An internal helper method that returns the shape
value along the ``soma_joinid`` index column, if the ``DataFrame
has one, else ``None``.
Expand All @@ -327,18 +327,18 @@ def _maybe_sjid_shape(self) -> Optional[int]:
Lifecycle:
Experimental.
"""
return self._handle.maybe_sjid_shape
return self._handle.maybe_soma_joinid_shape

@property
def _maybe_sjid_maxshape(self) -> Optional[int]:
def _maybe_soma_joinid_maxshape(self) -> Optional[int]:
"""An internal helper method that returns the maxshape
value along the ``soma_joinid`` index column, if the ``DataFrame
has one, else ``None``.
Lifecycle:
Experimental.
"""
return self._handle.maybe_sjid_maxshape
return self._handle.maybe_soma_joinid_maxshape

def __len__(self) -> int:
"""Returns the number of rows in the dataframe. Same as ``df.count``."""
Expand Down
12 changes: 6 additions & 6 deletions apis/python/src/tiledbsoma/_tdb_handles.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,12 +415,12 @@ def maxshape(self) -> Tuple[int, ...]:
return cast(Tuple[int, ...], tuple(self._handle.maxshape))

@property
def maybe_sjid_shape(self) -> Optional[int]:
def maybe_soma_joinid_shape(self) -> Optional[int]:
"""Only implemented for DataFrame."""
raise NotImplementedError

@property
def maybe_sjid_maxshape(self) -> Optional[int]:
def maybe_soma_joinid_maxshape(self) -> Optional[int]:
"""Only implemented for DataFrame."""
raise NotImplementedError

Expand All @@ -438,26 +438,26 @@ def write(self, values: pa.RecordBatch) -> None:
self._handle.write(values)

@property
def maybe_sjid_shape(self) -> Optional[int]:
def maybe_soma_joinid_shape(self) -> Optional[int]:
"""Return the shape slot for the soma_joinid dim, if the array has one.
This is an important test-point and dev-internal access-point,
in particular, for the tiledbsoma-io experiment-level resizer.
Lifecycle:
Maturing.
"""
return cast(Optional[int], self._handle.maybe_sjid_shape)
return cast(Optional[int], self._handle.maybe_soma_joinid_shape)

@property
def maybe_sjid_maxshape(self) -> Optional[int]:
def maybe_soma_joinid_maxshape(self) -> Optional[int]:
"""Return the maxshape slot for the soma_joinid dim, if the array has one.
This is an important test-point and dev-internal access-point,
in particular, for the tiledbsoma-io experiment-level resizer.
Lifecycle:
Maturing.
"""
return cast(Optional[int], self._handle.maybe_sjid_maxshape)
return cast(Optional[int], self._handle.maybe_soma_joinid_maxshape)


class DenseNDArrayWrapper(SOMAArrayWrapper[clib.SOMADenseNDArray]):
Expand Down
4 changes: 2 additions & 2 deletions apis/python/src/tiledbsoma/soma_dataframe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ void load_soma_dataframe(py::module& m) {
"index_column_names", &SOMADataFrame::index_column_names)

.def_property_readonly(
"maybe_sjid_shape", &SOMADataFrame::maybe_sjid_shape)
"maybe_soma_joinid_shape", &SOMADataFrame::maybe_soma_joinid_shape)
.def_property_readonly(
"maybe_sjid_maxshape", &SOMADataFrame::maybe_sjid_maxshape)
"maybe_soma_joinid_maxshape", &SOMADataFrame::maybe_soma_joinid_maxshape)
.def_property_readonly(
"count",
&SOMADataFrame::count,
Expand Down
4 changes: 2 additions & 2 deletions apis/python/tests/test_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ def test_dataframe(tmp_path, arrow_schema):
assert sdf.shape is None

# soma_joinid is not a dim here
assert sdf._maybe_sjid_shape is None
assert sdf._maybe_sjid_maxshape is None
assert sdf._maybe_soma_joinid_shape is None
assert sdf._maybe_soma_joinid_maxshape is None

# Read all
table = sdf.read().concat()
Expand Down
8 changes: 4 additions & 4 deletions apis/python/tests/test_shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@ def test_dataframe_basics(tmp_path, soma_joinid_domain, index_column_names):
with tiledbsoma.DataFrame.open(uri) as sdf:
has_sjid_dim = "soma_joinid" in index_column_names
if has_sjid_dim:
assert sdf._maybe_sjid_shape == 1 + soma_joinid_domain[1]
assert sdf._maybe_sjid_maxshape == 1 + soma_joinid_domain[1]
assert sdf._maybe_soma_joinid_shape == 1 + soma_joinid_domain[1]
assert sdf._maybe_soma_joinid_maxshape == 1 + soma_joinid_domain[1]
else:
assert sdf._maybe_sjid_shape is None
assert sdf._maybe_sjid_maxshape is None
assert sdf._maybe_soma_joinid_shape is None
assert sdf._maybe_soma_joinid_maxshape is None

assert len(sdf.non_empty_domain()) == len(index_column_names)
8 changes: 4 additions & 4 deletions apis/r/R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ maxshape <- function(uri, config = NULL) {
.Call(`_tiledbsoma_maxshape`, uri, config)
}

maybe_sjid_shape <- function(uri, config = NULL) {
.Call(`_tiledbsoma_maybe_sjid_shape`, uri, config)
maybe_soma_joinid_shape <- function(uri, config = NULL) {
.Call(`_tiledbsoma_maybe_soma_joinid_shape`, uri, config)
}

maybe_sjid_max_shape <- function(uri, config = NULL) {
.Call(`_tiledbsoma_maybe_sjid_max_shape`, uri, config)
maybe_soma_joinid_maxshape <- function(uri, config = NULL) {
.Call(`_tiledbsoma_maybe_soma_joinid_maxshape`, uri, config)
}

#' Iterator-Style Access to SOMA Array via SOMAArray
Expand Down
8 changes: 4 additions & 4 deletions apis/r/R/SOMADataFrame.R
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,8 @@ SOMADataFrame <- R6::R6Class(
#' @description TO WRITE
#' (lifecycle: maturing)
#' @return TO WRITE
.maybe_sjid_maxshape = function() {
as.integer64(maybe_sjid_maxshape(
.maybe_soma_joinid_maxshape = function() {
as.integer64(maybe_soma_joinid_maxshape(
self$uri,
config=as.character(tiledb::config(self$tiledbsoma_ctx$context()))
))
Expand All @@ -354,8 +354,8 @@ SOMADataFrame <- R6::R6Class(
#' @description TO WRITE
#' (lifecycle: maturing)
#' @return TO WRITE
.maybe_sjid_shape = function() {
as.integer64(maybe_sjid_shape(
.maybe_soma_joinid_shape = function() {
as.integer64(maybe_soma_joinid_shape(
self$uri,
config=as.character(tiledb::config(self$tiledbsoma_ctx$context()))
))
Expand Down
20 changes: 10 additions & 10 deletions apis/r/src/RcppExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,27 +272,27 @@ BEGIN_RCPP
return rcpp_result_gen;
END_RCPP
}
// maybe_sjid_shape
Rcpp::Nullable<Rcpp::NumericVector> maybe_sjid_shape(const std::string& uri, Rcpp::Nullable<Rcpp::CharacterVector> config);
RcppExport SEXP _tiledbsoma_maybe_sjid_shape(SEXP uriSEXP, SEXP configSEXP) {
// maybe_soma_joinid_shape
Rcpp::Nullable<Rcpp::NumericVector> maybe_soma_joinid_shape(const std::string& uri, Rcpp::Nullable<Rcpp::CharacterVector> config);
RcppExport SEXP _tiledbsoma_maybe_soma_joinid_shape(SEXP uriSEXP, SEXP configSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< const std::string& >::type uri(uriSEXP);
Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::CharacterVector> >::type config(configSEXP);
rcpp_result_gen = Rcpp::wrap(maybe_sjid_shape(uri, config));
rcpp_result_gen = Rcpp::wrap(maybe_soma_joinid_shape(uri, config));
return rcpp_result_gen;
END_RCPP
}
// maybe_sjid_max_shape
Rcpp::Nullable<Rcpp::NumericVector> maybe_sjid_max_shape(const std::string& uri, Rcpp::Nullable<Rcpp::CharacterVector> config);
RcppExport SEXP _tiledbsoma_maybe_sjid_max_shape(SEXP uriSEXP, SEXP configSEXP) {
// maybe_soma_joinid_maxshape
Rcpp::Nullable<Rcpp::NumericVector> maybe_soma_joinid_maxshape(const std::string& uri, Rcpp::Nullable<Rcpp::CharacterVector> config);
RcppExport SEXP _tiledbsoma_maybe_soma_joinid_maxshape(SEXP uriSEXP, SEXP configSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< const std::string& >::type uri(uriSEXP);
Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::CharacterVector> >::type config(configSEXP);
rcpp_result_gen = Rcpp::wrap(maybe_sjid_max_shape(uri, config));
rcpp_result_gen = Rcpp::wrap(maybe_soma_joinid_maxshape(uri, config));
return rcpp_result_gen;
END_RCPP
}
Expand Down Expand Up @@ -486,8 +486,8 @@ static const R_CallMethodDef CallEntries[] = {
{"_tiledbsoma_check_arrow_array_tag", (DL_FUNC) &_tiledbsoma_check_arrow_array_tag, 1},
{"_tiledbsoma_shape", (DL_FUNC) &_tiledbsoma_shape, 2},
{"_tiledbsoma_maxshape", (DL_FUNC) &_tiledbsoma_maxshape, 2},
{"_tiledbsoma_maybe_sjid_shape", (DL_FUNC) &_tiledbsoma_maybe_sjid_shape, 2},
{"_tiledbsoma_maybe_sjid_max_shape", (DL_FUNC) &_tiledbsoma_maybe_sjid_max_shape, 2},
{"_tiledbsoma_maybe_soma_joinid_shape", (DL_FUNC) &_tiledbsoma_maybe_soma_joinid_shape, 2},
{"_tiledbsoma_maybe_soma_joinid_maxshape", (DL_FUNC) &_tiledbsoma_maybe_soma_joinid_maxshape, 2},
{"_tiledbsoma_sr_setup", (DL_FUNC) &_tiledbsoma_sr_setup, 10},
{"_tiledbsoma_sr_complete", (DL_FUNC) &_tiledbsoma_sr_complete, 1},
{"_tiledbsoma_create_empty_arrow_table", (DL_FUNC) &_tiledbsoma_create_empty_arrow_table, 0},
Expand Down
8 changes: 4 additions & 4 deletions apis/r/src/rinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,14 @@ Rcpp::NumericVector maxshape(const std::string& uri,
}

// [[Rcpp::export]]
Rcpp::Nullable<Rcpp::NumericVector> maybe_sjid_shape(const std::string& uri,
Rcpp::Nullable<Rcpp::NumericVector> maybe_soma_joinid_shape(const std::string& uri,
Rcpp::Nullable<Rcpp::CharacterVector> config = R_NilValue) {
// Pro-tip:
// * Open with mode and uri gives a SOMAArray.
// * Open with uri and mode gives a SOMADataFrame.
// This was done intentionally to resolve an ambiguous-overload compiler error.
auto sr = tdbs::SOMADataFrame::open(uri, OpenMode::read, "unnamed", config_vector_to_map(Rcpp::wrap(config)));
auto retval = sr->maybe_sjid_shape();
auto retval = sr->maybe_soma_joinid_shape();
if (retval.has_value()) {
return Rcpp::toInteger64(retval.value());
} else {
Expand All @@ -259,10 +259,10 @@ Rcpp::Nullable<Rcpp::NumericVector> maybe_sjid_shape(const std::string& uri,
}

// [[Rcpp::export]]
Rcpp::Nullable<Rcpp::NumericVector> maybe_sjid_max_shape(const std::string& uri,
Rcpp::Nullable<Rcpp::NumericVector> maybe_soma_joinid_maxshape(const std::string& uri,
Rcpp::Nullable<Rcpp::CharacterVector> config = R_NilValue) {
auto sr = tdbs::SOMADataFrame::open(uri, OpenMode::read, "unnamed", config_vector_to_map(Rcpp::wrap(config)));
auto retval = sr->maybe_sjid_maxshape();
auto retval = sr->maybe_soma_joinid_maxshape();
if (retval.has_value()) {
return Rcpp::toInteger64(retval.value());
} else {
Expand Down

0 comments on commit aa02a85

Please sign in to comment.