Skip to content

Commit d1f752c

Browse files
committed
deprecate arg
1 parent c6f4f1c commit d1f752c

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/squidpy/gr/_ligrec.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@
2323
from squidpy._constants._constants import ComplexPolicy, CorrAxis
2424
from squidpy._constants._pkg_constants import Key
2525
from squidpy._docs import d, inject_docs
26-
from squidpy._utils import NDArrayA
26+
from squidpy._utils import NDArrayA, deprecated_params
2727
from squidpy.gr._utils import (
2828
_assert_categorical_obs,
2929
_assert_positive,
3030
_check_tuple_needles,
3131
_genesymbols,
3232
_save_data,
33+
extract_adata,
3334
)
3435

3536
__all__ = ["ligrec", "PermutationTest"]
@@ -537,6 +538,7 @@ def prepare(
537538

538539

539540
@d.dedent
541+
@deprecated_params({"numba_parallel": "1.10.0"})
540542
def ligrec(
541543
adata: AnnData | SpatialData,
542544
cluster_key: str,
@@ -558,6 +560,8 @@ def ligrec(
558560
interactions_params: Mapping[str, Any] = MappingProxyType({}),
559561
transmitter_params: Mapping[str, Any] = MappingProxyType({"categories": "ligand"}),
560562
receiver_params: Mapping[str, Any] = MappingProxyType({"categories": "receptor"}),
563+
*,
564+
table_key: str = "table",
561565
) -> Mapping[str, pd.DataFrame] | None:
562566
"""
563567
%(PT_test.full_desc)s
@@ -574,8 +578,7 @@ def ligrec(
574578
-------
575579
%(ligrec_test_returns)s
576580
""" # noqa: D400
577-
if isinstance(adata, SpatialData):
578-
adata = adata.table
581+
adata = extract_adata(adata, table_key=table_key)
579582
with _genesymbols(adata, key=gene_symbols, use_raw=use_raw, make_unique=False):
580583
return ( # type: ignore[no-any-return]
581584
PermutationTest(adata, use_raw=use_raw)

0 commit comments

Comments
 (0)