Skip to content

Commit a4938c1

Browse files
authored
fix: update default init values for benchmarker (#203)
* update to bio_conservation_metrics, batch_correction_metrics deafult values * added log and test * typo
1 parent fc28c2a commit a4938c1

File tree

4 files changed

+25
-5
lines changed

4 files changed

+25
-5
lines changed

CHANGELOG.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,17 @@ and this project adheres to [Semantic Versioning][].
1010

1111
## 0.6.0 (unreleased)
1212

13+
## 0.5.4 (2025-04-23)
14+
15+
### Fixed
16+
17+
- Apply default values for benchmarker metrics {pr}`203`.
18+
1319
## 0.5.3 (2025-02-17)
1420

15-
#### Removed
21+
### Removed
1622

17-
- Reverted the change for scib-autotune in scvi-tools {pr}`189`.
23+
- Reverted a change that was needed for scib-autotune in scvi-tools {pr}`189`.
1824

1925
## 0.5.2 (2025-02-13)
2026

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ requires = ["hatchling"]
55

66
[project]
77
name = "scib-metrics"
8-
version = "0.5.3"
8+
version = "0.5.4"
99
description = "Accelerated and Python-only scIB metrics"
1010
readme = "README.md"
1111
requires-python = ">=3.10"

src/scib_metrics/benchmark/_core.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ def __init__(
136136
batch_key: str,
137137
label_key: str,
138138
embedding_obsm_keys: list[str],
139-
bio_conservation_metrics: BioConservation | None,
140-
batch_correction_metrics: BatchCorrection | None,
139+
bio_conservation_metrics: BioConservation | None = BioConservation(),
140+
batch_correction_metrics: BatchCorrection | None = BatchCorrection(),
141141
pre_integrated_embedding_obsm_key: str | None = None,
142142
n_jobs: int = 1,
143143
progress_bar: bool = True,

tests/test_benchmarker.py

+14
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,20 @@ def test_benchmarker():
2121
bm.plot_results_table()
2222

2323

24+
def test_benchmarker_default():
25+
ad, emb_keys, batch_key, labels_key = dummy_benchmarker_adata()
26+
bm = Benchmarker(
27+
ad,
28+
batch_key,
29+
labels_key,
30+
emb_keys,
31+
)
32+
bm.benchmark()
33+
results = bm.get_results()
34+
assert isinstance(results, pd.DataFrame)
35+
bm.plot_results_table()
36+
37+
2438
def test_benchmarker_custom_metric_booleans():
2539
bioc = BioConservation(
2640
isolated_labels=False, nmi_ari_cluster_labels_leiden=False, silhouette_label=False, clisi_knn=True

0 commit comments

Comments
 (0)