Skip to content

Commit

Permalink
Add back deprecated function tiledbsoma_build_index
Browse files Browse the repository at this point in the history
  • Loading branch information
jp-dark committed Mar 27, 2024
1 parent e6822fb commit 89cc496
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 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
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)

Check warning on line 44 in apis/python/src/tiledbsoma/_indexer.py

View check run for this annotation

Codecov / codecov/patch

apis/python/src/tiledbsoma/_indexer.py#L44

Added line #L44 was not covered by tests


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 89cc496

Please sign in to comment.