Skip to content

Commit

Permalink
Post-rebase corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenv committed Oct 20, 2023
1 parent 04f0144 commit 2c8fa29
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion apis/python/src/tiledbsoma/_sparse_nd_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def used_shape(self) -> Tuple[Tuple[int, int], ...]:
# In the unlikely event that a previous data update succeeded but the
# subsequent metadata update did not, take the union of the core non-empty domain
# (which is done as part of the data update) and the metadata bounding box.
ned = self.non_empty_domain()
ned = self.non_empty_domain() or tuple()
for i, nedslot in enumerate(ned):
ned_lower, ned_upper = nedslot
bbox_lower, bbox_upper = retval[i]
Expand Down
17 changes: 7 additions & 10 deletions apis/python/src/tiledbsoma/_tdb_handles.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,16 +200,12 @@ def _opener(
def schema(self) -> tiledb.ArraySchema:
return self._handle.schema

def non_empty_domain(self) -> Tuple[Tuple[int, int], ...]:
"""
Retrieves the non-empty domain for each dimension, namely the smallest
and largest indices in each dimension for which the array/dataframe has
data occupied. This is nominally the same as the domain used at
creation time, but if for example only a portion of the available domain
has actually had data written, this function will return a tighter
range.
"""
return self._handle.nonempty_domain() # type: ignore
def non_empty_domain(self) -> Optional[Tuple[Tuple[Any, Any], ...]]:
try:
ned: Optional[Tuple[Tuple[Any, Any], ...]] = self._handle.nonempty_domain()
return ned
except tiledb.TileDBError as e:
raise SOMAError(e)

@property
def domain(self) -> Tuple[Tuple[Any, Any], ...]:
Expand All @@ -230,6 +226,7 @@ def dim_names(self) -> Tuple[str, ...]:
schema = self._handle.schema
return tuple(schema.domain.dim(i).name for i in range(schema.domain.ndim))


@attrs.define(frozen=True)
class GroupEntry:
uri: str
Expand Down
2 changes: 1 addition & 1 deletion apis/python/src/tiledbsoma/_tiledb_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def schema(self) -> pa.Schema:
else:
return self._tiledb_array_schema()

def non_empty_domain(self) -> Tuple[Tuple[int, int], ...]:
def non_empty_domain(self) -> Optional[Tuple[Tuple[Any, Any], ...]]:
"""
Retrieves the non-empty domain for each dimension, namely the smallest
and largest indices in each dimension for which the array/dataframe has
Expand Down

0 comments on commit 2c8fa29

Please sign in to comment.