From f166a7f4181b127e89cd1e1a635fd06da9bde116 Mon Sep 17 00:00:00 2001 From: Martin Kim Date: Mon, 14 Aug 2023 11:09:50 -0700 Subject: [PATCH] Fix settings import --- src/scib_metrics/_nmi_ari.py | 5 ++--- src/scib_metrics/_pcr_comparison.py | 5 ++--- src/scib_metrics/benchmark/_core.py | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/scib_metrics/_nmi_ari.py b/src/scib_metrics/_nmi_ari.py index 715fe0b..47ada34 100644 --- a/src/scib_metrics/_nmi_ari.py +++ b/src/scib_metrics/_nmi_ari.py @@ -8,8 +8,7 @@ from sklearn.metrics.cluster import adjusted_rand_score, normalized_mutual_info_score from sklearn.utils import check_array -from scib_metrics import settings - +from ._settings import warnings_stacklevel from .utils import KMeans, check_square logger = logging.getLogger(__name__) @@ -115,7 +114,7 @@ def nmi_ari_cluster_labels_leiden( warnings.warn( "Using for loop over clustering resolutions. `pip install joblib` for parallelization.", UserWarning, - stacklevel=settings.warnings_stacklevel, + stacklevel=warnings_stacklevel, ) out = [_compute_nmi_ari_cluster_labels(X, labels, r) for r in resolutions] nmi_ari = np.array(out) diff --git a/src/scib_metrics/_pcr_comparison.py b/src/scib_metrics/_pcr_comparison.py index 2637519..f8e1b83 100644 --- a/src/scib_metrics/_pcr_comparison.py +++ b/src/scib_metrics/_pcr_comparison.py @@ -1,7 +1,6 @@ import warnings -from scib_metrics import settings - +from ._settings import warnings_stacklevel from ._types import NdArray from .utils import principal_component_regression @@ -52,7 +51,7 @@ def pcr_comparison( "PCR comparison score is negative, meaning variance contribution " "increased after integration. Setting to 0.", UserWarning, - stacklevel=settings.warnings_stacklevel, + stacklevel=warnings_stacklevel, ) pcr_compared = 0 else: diff --git a/src/scib_metrics/benchmark/_core.py b/src/scib_metrics/benchmark/_core.py index f9bc12a..8069069 100644 --- a/src/scib_metrics/benchmark/_core.py +++ b/src/scib_metrics/benchmark/_core.py @@ -18,7 +18,7 @@ from tqdm import tqdm import scib_metrics -from scib_metrics import settings +from scib_metrics._settings import warnings_stacklevel from scib_metrics.nearest_neighbors import NeighborsOutput, pynndescent Kwargs = Dict[str, Any] @@ -205,7 +205,7 @@ def benchmark(self) -> None: warnings.warn( "The benchmark has already been run. Running it again will overwrite the previous results.", UserWarning, - stacklevel=settings.warnings_stacklevel, + stacklevel=warnings_stacklevel, ) if not self._prepared: