From 27893ad8e05414c8d512c4f362e8c7dfe9e0ddfd Mon Sep 17 00:00:00 2001 From: "selman.ozleyen" Date: Mon, 23 Feb 2026 11:26:14 +0100 Subject: [PATCH 1/2] remove the params --- src/squidpy/gr/_ppatterns.py | 10 +--------- tests/graph/test_ppatterns.py | 8 +++----- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/squidpy/gr/_ppatterns.py b/src/squidpy/gr/_ppatterns.py index 292c75994..2202dc630 100644 --- a/src/squidpy/gr/_ppatterns.py +++ b/src/squidpy/gr/_ppatterns.py @@ -348,10 +348,6 @@ def co_occurrence( spatial_key: str = Key.obsm.spatial, interval: int | NDArrayA = 50, copy: bool = False, - n_splits: int | None = None, - n_jobs: int | None = None, - backend: str = "loky", - show_progress_bar: bool = True, ) -> tuple[NDArrayA, NDArrayA] | None: """ Compute co-occurrence probability of clusters. @@ -365,10 +361,6 @@ def co_occurrence( Distances interval at which co-occurrence is computed. If :class:`int`, uniformly spaced interval of the given size will be used. %(copy)s - n_splits - Number of splits in which to divide the spatial coordinates in - :attr:`anndata.AnnData.obsm` ``['{spatial_key}']``. - %(parallelize)s Returns ------- @@ -407,7 +399,7 @@ def co_occurrence( # Compute co-occurrence probabilities using the fast numba routine. out = _co_occurrence_helper(spatial_x, spatial_y, interval, labs) start = logg.info( - f"Calculating co-occurrence probabilities for `{len(interval)}` intervals using `{n_jobs}` core(s) and `{n_splits}` splits" + f"Calculating co-occurrence probabilities for `{len(interval)}` intervals" ) if copy: diff --git a/tests/graph/test_ppatterns.py b/tests/graph/test_ppatterns.py index 226fb2830..01c2e3033 100644 --- a/tests/graph/test_ppatterns.py +++ b/tests/graph/test_ppatterns.py @@ -137,12 +137,10 @@ def test_co_occurrence(adata: AnnData): assert arr.shape[1] == arr.shape[0] == adata.obs["leiden"].unique().shape[0] -# @pytest.mark.parametrize(("ys", "xs"), [(10, 10), (None, None), (10, 20)]) -@pytest.mark.parametrize(("n_jobs", "n_splits"), [(1, 2), (2, 2)]) -def test_co_occurrence_reproducibility(adata: AnnData, n_jobs: int, n_splits: int): +def test_co_occurrence_reproducibility(adata: AnnData): """Check co_occurrence reproducibility results.""" - arr_1, interval_1 = co_occurrence(adata, cluster_key="leiden", copy=True, n_jobs=n_jobs, n_splits=n_splits) - arr_2, interval_2 = co_occurrence(adata, cluster_key="leiden", copy=True, n_jobs=n_jobs, n_splits=n_splits) + arr_1, interval_1 = co_occurrence(adata, cluster_key="leiden", copy=True) + arr_2, interval_2 = co_occurrence(adata, cluster_key="leiden", copy=True) np.testing.assert_array_equal(sorted(interval_1), sorted(interval_2)) np.testing.assert_allclose(arr_1, arr_2) From 1b194944d21aa9638f92905b8cb0514eb50fdcfd Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 10:32:17 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/squidpy/gr/_ppatterns.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/squidpy/gr/_ppatterns.py b/src/squidpy/gr/_ppatterns.py index 2202dc630..3e8cb7b04 100644 --- a/src/squidpy/gr/_ppatterns.py +++ b/src/squidpy/gr/_ppatterns.py @@ -398,9 +398,7 @@ def co_occurrence( # Compute co-occurrence probabilities using the fast numba routine. out = _co_occurrence_helper(spatial_x, spatial_y, interval, labs) - start = logg.info( - f"Calculating co-occurrence probabilities for `{len(interval)}` intervals" - ) + start = logg.info(f"Calculating co-occurrence probabilities for `{len(interval)}` intervals") if copy: logg.info("Finish", time=start)