Skip to content

Commit

Permalink
Add back deprecated function tiledbsoma_build_index (#2344) (#2346)
Browse files Browse the repository at this point in the history
* Add back deprecated function `tiledbsoma_build_index`

* Add function to __all__

Co-authored-by: Julia Dark <24235303+jp-dark@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and jp-dark authored Mar 27, 2024
1 parent adf352f commit 1a5c532
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
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

0 comments on commit 1a5c532

Please sign in to comment.