Skip to content

Commit

Permalink
Fix settings import
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Kim committed Aug 14, 2023
1 parent 79bb8c9 commit f166a7f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
5 changes: 2 additions & 3 deletions src/scib_metrics/_nmi_ari.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions src/scib_metrics/_pcr_comparison.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions src/scib_metrics/benchmark/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit f166a7f

Please sign in to comment.