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

[Backport release-1.9] [python] Add back deprecated function tiledbsoma_build_index #2346

Merged
merged 1 commit into from
Mar 27, 2024
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
3 changes: 2 additions & 1 deletion apis/python/src/tiledbsoma/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
get_storage_engine,
show_package_versions,
)
from ._indexer import IntIndexer
from ._indexer import IntIndexer, tiledbsoma_build_index
from ._measurement import Measurement
from ._sparse_nd_array import SparseNDArray
from .options import SOMATileDBContext, TileDBCreateOptions
Expand Down Expand Up @@ -193,6 +193,7 @@
"SOMATileDBContext",
"SparseNDArray",
"TileDBCreateOptions",
"tiledbsoma_build_index",
"tiledbsoma_stats_disable",
"tiledbsoma_stats_dump",
"tiledbsoma_stats_enable",
Expand Down
23 changes: 22 additions & 1 deletion apis/python/src/tiledbsoma/_indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import numpy.typing as npt
import pandas as pd
import pyarrow as pa
from somacore.query.types import IndexLike

from tiledbsoma import pytiledbsoma as clib

Expand All @@ -23,6 +24,26 @@
]


def tiledbsoma_build_index(
data: IndexerDataType, *, context: Optional["SOMATileDBContext"] = None
) -> IndexLike:
"""Initialize re-indexer for provided indices.

Deprecated. Provides the same functionality as the``IntIndexer`` class.

Args:
data:
Integer keys used to build the index (hash) table.
context:
``SOMATileDBContext`` object containing concurrecy level.

Lifecycle:
Deprecated.
"""

return IntIndexer(data, context=context)


class IntIndexer:
"""A re-indexer for unique integer indices.

Expand All @@ -33,7 +54,7 @@ class IntIndexer:
def __init__(
self, data: IndexerDataType, *, context: Optional["SOMATileDBContext"] = None
):
"""Initialize re-indexer for provied indices.
"""Initialize re-indexer for provided indices.

Args:
data:
Expand Down
Loading