Skip to content

Commit 0401028

Browse files
Test all metadata (openproblems-bio#813)
* make sure metadata tests run * transfer meta * test all metadata * fix docker * fix path * undo rename * fix * separate metadata tests * bump test coverage
1 parent 5be696e commit 0401028

29 files changed

+128
-189
lines changed

.coveragerc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
[run]
22
parallel = true
33
branch = true
4-
source = openproblems
5-
omit = */__init__.py
4+
source =
5+
openproblems
6+
test
7+
omit =
8+
*/__init__.py
9+
test/utils/*.py
610

711
[report]
812
exclude_lines =

.github/workflows/run_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,13 +313,13 @@ jobs:
313313
if: "needs.build_images.result == 'skipped'"
314314
run: |
315315
cd workflow
316-
snakemake -j $(nproc) docker_pull
316+
snakemake -j $(nproc) docker
317317
cd ..
318318
319319
- name: Run tests
320320
timeout-minutes: 60
321321
run: |
322-
pytest --cov=openproblems --cov-report=xml -vv --durations=15 --tb=native -k "${{ matrix.tests }}"
322+
pytest --cov=openproblems --cov=test --cov-report=xml -vv --durations=15 --tb=native -k "${{ matrix.tests }}"
323323
mkdir -p coverage
324324
mv coverage.xml "$(echo 'coverage_${{ matrix.tests }}.xml' | sed 's/[^a-z0-9\.]/_/g')"
325325

openproblems/tasks/_batch_integration/batch_integration_embed/metrics/ari.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@
1414
"""
1515

1616

17-
@metric(
18-
metric_name="ARI",
19-
maximize=True,
20-
paper_reference="luecken2022benchmarking",
21-
image="openproblems-r-pytorch",
22-
)
17+
@metric(**graph_metrics.ari.metadata)
2318
def ari(adata):
2419
from scanpy.pp import neighbors
2520

openproblems/tasks/_batch_integration/batch_integration_embed/metrics/graph_connectivity.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,7 @@
2020
"""
2121

2222

23-
@metric(
24-
metric_name="Graph connectivity",
25-
paper_reference="luecken2022benchmarking",
26-
maximize=True,
27-
image="openproblems-r-pytorch",
28-
)
23+
@metric(**graph_metrics.graph_connectivity.metadata)
2924
def graph_connectivity(adata):
3025
from scanpy.pp import neighbors
3126

openproblems/tasks/_batch_integration/batch_integration_embed/metrics/iso_label_f1.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,7 @@
2525
"""
2626

2727

28-
@metric(
29-
metric_name="Isolated label F1",
30-
paper_reference="luecken2022benchmarking",
31-
maximize=True,
32-
image="openproblems-r-pytorch",
33-
)
28+
@metric(**graph_metrics.isolated_labels_f1.metadata)
3429
def isolated_labels_f1(adata):
3530
from scanpy.pp import neighbors
3631

openproblems/tasks/_batch_integration/batch_integration_embed/metrics/nmi.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,7 @@
1313
"""
1414

1515

16-
@metric(
17-
metric_name="NMI",
18-
paper_reference="luecken2022benchmarking",
19-
maximize=True,
20-
image="openproblems-r-pytorch",
21-
)
16+
@metric(**graph_metrics.nmi.metadata)
2217
def nmi(adata):
2318
from scanpy.pp import neighbors
2419

openproblems/tasks/_batch_integration/batch_integration_feature/metrics/ari.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@
1414
"""
1515

1616

17-
@metric(
18-
metric_name="ARI",
19-
maximize=True,
20-
paper_reference="luecken2022benchmarking",
21-
image="openproblems-r-pytorch",
22-
)
17+
@metric(**graph_metrics.ari.metadata)
2318
def ari(adata):
2419
from scanpy.pp import neighbors
2520
from scanpy.tl import pca

openproblems/tasks/_batch_integration/batch_integration_feature/metrics/cc_score.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,7 @@
1919
the preintegration variance contribution reduces the score."""
2020

2121

22-
@metric(
23-
metric_name="Cell Cycle Score",
24-
paper_reference="luecken2022benchmarking",
25-
maximize=True,
26-
image="openproblems-r-pytorch",
27-
)
22+
@metric(**embed_metrics.cc_score.metadata)
2823
def cc_score(adata, test=False):
2924
from scanpy.tl import pca
3025

openproblems/tasks/_batch_integration/batch_integration_feature/metrics/graph_connectivity.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,7 @@
2020
"""
2121

2222

23-
@metric(
24-
metric_name="Graph connectivity",
25-
paper_reference="luecken2022benchmarking",
26-
maximize=True,
27-
image="openproblems-r-pytorch",
28-
)
23+
@metric(**graph_metrics.graph_connectivity.metadata)
2924
def graph_connectivity(adata):
3025
from scanpy.pp import neighbors
3126
from scanpy.tl import pca

openproblems/tasks/_batch_integration/batch_integration_feature/metrics/iso_label_f1.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,7 @@
2525
"""
2626

2727

28-
@metric(
29-
metric_name="Isolated label F1",
30-
paper_reference="luecken2022benchmarking",
31-
maximize=True,
32-
image="openproblems-r-pytorch",
33-
)
28+
@metric(**graph_metrics.isolated_labels_f1.metadata)
3429
def isolated_labels_f1(adata):
3530
from scanpy.pp import neighbors
3631
from scanpy.tl import pca

0 commit comments

Comments
 (0)