Skip to content

Commit

Permalink
add postfix str to indicate metric, warn about no joblib (#80)
Browse files Browse the repository at this point in the history
* add postfix str to indicate metric

* add warning for joblib

* changelog

* bump version
  • Loading branch information
adamgayoso authored Feb 15, 2023
1 parent a247559 commit 4a04662
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,18 @@ and this project adheres to [Semantic Versioning][].
[keep a changelog]: https://keepachangelog.com/en/1.0.0/
[semantic versioning]: https://semver.org/spec/v2.0.0.html

## 0.2.1 (2022-02-16)

- Warn about joblib, add progress bar postfix str ([#80][])

[#80]: https://github.com/YosefLab/scib-metrics/pull/80

## 0.2.0 (2022-02-02)

- Allow custom nearest neighbors methods in Benchmarker ([#78][])

[#78]: https://github.com/YosefLab/scib-metrics/pull/78

## 0.1.1 (2022-01-04)

- Add new tutorial and fix scalability of lisi ([#71][])
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ requires = ["hatchling"]

[project]
name = "scib-metrics"
version = "0.2.0"
version = "0.2.1"
description = "Accelerated and Python-only scIB metrics"
readme = "README.md"
requires-python = ">=3.8"
Expand Down
3 changes: 2 additions & 1 deletion src/scib_metrics/_nmi_ari.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import warnings
from typing import Dict, Tuple

import numpy as np
Expand Down Expand Up @@ -109,7 +110,7 @@ def nmi_ari_cluster_labels_leiden(

out = Parallel(n_jobs=n_jobs)(delayed(_compute_nmi_ari_cluster_labels)(X, labels, r) for r in resolutions)
except ImportError:
logger.info("Using for loop over resolutions. pip install joblib for parallelization.")
warnings.warn("Using for loop over clustering resolutions. `pip install joblib` for parallelization.")
out = [_compute_nmi_ari_cluster_labels(X, labels, r) for r in resolutions]
nmi_ari = np.array(out)
nmi_ind = np.argmax(nmi_ari[:, 0])
Expand Down
1 change: 1 addition & 0 deletions src/scib_metrics/benchmark/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def benchmark(self) -> None:
for metric_type, metric_collection in self._metric_collection_dict.items():
for metric_name, use_metric_or_kwargs in asdict(metric_collection).items():
if use_metric_or_kwargs:
pbar.set_postfix_str(f"{metric_type}: {metric_name}")
metric_fn = getattr(scib_metrics, metric_name)
if isinstance(use_metric_or_kwargs, dict):
# Kwargs in this case
Expand Down

0 comments on commit 4a04662

Please sign in to comment.