Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disallow duplicates #199

Merged
merged 2 commits into from
Jun 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apis/python/src/tiledbsc/annotation_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def from_dataframe(self, dataframe: pd.DataFrame, extent: int = 2048) -> None:
dataframe=dataframe,
name=self.name,
sparse=True,
allows_duplicates=False,
allows_duplicates=self._soma_options.allows_duplicates,
offsets_filters=offsets_filters,
attr_filters=attr_filters,
dim_filters=dim_filters,
Expand Down
2 changes: 1 addition & 1 deletion apis/python/src/tiledbsc/annotation_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def _create_empty_array(self, matrix_dtypes, attr_names) -> None:
domain=dom,
attrs=attrs,
sparse=True,
allows_duplicates=True,
allows_duplicates=self._soma_options.allows_duplicates,
offsets_filters=[
tiledb.DoubleDeltaFilter(),
tiledb.BitWidthReductionFilter(),
Expand Down
2 changes: 1 addition & 1 deletion apis/python/src/tiledbsc/assay_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def _create_empty_array(self, matrix_dtype: np.dtype) -> None:
domain=dom,
attrs=(att,),
sparse=True,
allows_duplicates=True,
allows_duplicates=self._soma_options.allows_duplicates,
offsets_filters=[
tiledb.DoubleDeltaFilter(),
tiledb.BitWidthReductionFilter(),
Expand Down
3 changes: 3 additions & 0 deletions apis/python/src/tiledbsc/soma_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class SOMAOptions:
write_X_chunked: bool
goal_chunk_nnz: int
member_uris_are_relative: bool
allows_duplicates: bool

def __init__(
self,
Expand All @@ -27,6 +28,7 @@ def __init__(
write_X_chunked=True,
goal_chunk_nnz=20_000_000,
member_uris_are_relative=None, # Allows relocatability for local disk / S3, and correct behavior for TileDB Cloud
allows_duplicates=False,
):
self.obs_extent = obs_extent
self.var_extent = var_extent
Expand All @@ -37,3 +39,4 @@ def __init__(
self.write_X_chunked = write_X_chunked
self.goal_chunk_nnz = goal_chunk_nnz
self.member_uris_are_relative = member_uris_are_relative
self.allows_duplicates = allows_duplicates
4 changes: 2 additions & 2 deletions apis/python/src/tiledbsc/uns_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def from_pandas_dataframe(self, df: pd.DataFrame) -> None:
uri=self.uri,
dataframe=df,
sparse=True,
allows_duplicates=False,
allows_duplicates=self._soma_options.allows_duplicates,
ctx=self._ctx,
)

Expand Down Expand Up @@ -169,7 +169,7 @@ def create_empty_array_for_csr(
domain=dom,
attrs=(att,),
sparse=True,
allows_duplicates=True,
allows_duplicates=self._soma_options.allows_duplicates,
offsets_filters=[
tiledb.DoubleDeltaFilter(),
tiledb.BitWidthReductionFilter(),
Expand Down