Skip to content

Commit 61af4c6

Browse files
committed
Run black formatting on python test scripts.
Run black formatting on python test scripts.
1 parent b05f102 commit 61af4c6

File tree

3 files changed

+28
-18
lines changed

3 files changed

+28
-18
lines changed

tests/test_aucell.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,24 @@
88
from pyscenic.aucell import aucell, create_rankings, derive_auc_threshold
99

1010
NOMENCLATURE = "HGNC"
11-
TEST_EXPRESSION_MTX_FNAME = resource_filename('resources.tests', "GSE103322.em.hgnc.sample.cxg.csv")
12-
TEST_SIGNATURE_FNAME = resource_filename('resources.tests', "c6.all.v6.1.symbols.gmt")
11+
TEST_EXPRESSION_MTX_FNAME = resource_filename(
12+
"resources.tests", "GSE103322.em.hgnc.sample.cxg.csv"
13+
)
14+
TEST_SIGNATURE_FNAME = resource_filename("resources.tests", "c6.all.v6.1.symbols.gmt")
1315

1416

1517
@pytest.fixture
1618
def exp_matrix():
17-
return pd.read_csv(TEST_EXPRESSION_MTX_FNAME, sep=',', header=0, index_col=0)
19+
return pd.read_csv(TEST_EXPRESSION_MTX_FNAME, sep=",", header=0, index_col=0)
1820

1921

2022
@pytest.fixture
2123
def gs():
22-
return GeneSignature.from_gmt(TEST_SIGNATURE_FNAME, gene_separator="\t", field_separator="\t", )
24+
return GeneSignature.from_gmt(
25+
TEST_SIGNATURE_FNAME,
26+
gene_separator="\t",
27+
field_separator="\t",
28+
)
2329

2430

2531
def test_create_rankings(exp_matrix):
@@ -41,6 +47,8 @@ def test_aucell_w2(exp_matrix, gs):
4147

4248
def test_aucell_mismatch(exp_matrix, gs):
4349
percentiles = derive_auc_threshold(exp_matrix)
44-
gss = [GeneSignature(name="test", gene2weight=list(map("FAKE{}".format, range(100))))] + gs
50+
gss = [
51+
GeneSignature(name="test", gene2weight=list(map("FAKE{}".format, range(100))))
52+
] + gs
4553
aucs_mtx = aucell(exp_matrix, gss, auc_threshold=percentiles[0.01], num_workers=1)
4654
print(aucs_mtx.head())

tests/test_featureseq.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,29 @@
55

66

77
def test_feature_overlap():
8-
f1 = Feature.from_string('chr1 12 50 feature1 10.0 +')
9-
f2 = Feature.from_string('chr1 40 60 feature2 10.0 -')
10-
f3 = Feature.from_string('chr1 60 80 feature2 10.0 -')
11-
f4 = Feature.from_string('chr2 60 80 feature2 10.0 -')
8+
f1 = Feature.from_string("chr1 12 50 feature1 10.0 +")
9+
f2 = Feature.from_string("chr1 40 60 feature2 10.0 -")
10+
f3 = Feature.from_string("chr1 60 80 feature2 10.0 -")
11+
f4 = Feature.from_string("chr2 60 80 feature2 10.0 -")
1212
assert f1.has_overlap_with(f2)
1313
assert not f1.has_overlap_with(f3)
1414
assert not f3.has_overlap_with(f4)
1515
assert not f2.has_overlap_with(f3)
1616

1717

1818
def test_feature_contains():
19-
f1 = Feature.from_string('chr1 50 60 feature1 10.0 +')
20-
f2 = Feature.from_string('chr1 40 60 feature2 10.0 -')
21-
f3 = Feature.from_string('chr2 40 80 feature2 10.0 -')
19+
f1 = Feature.from_string("chr1 50 60 feature1 10.0 +")
20+
f2 = Feature.from_string("chr1 40 60 feature2 10.0 -")
21+
f3 = Feature.from_string("chr2 40 80 feature2 10.0 -")
2222
assert f1 in f2
2323
assert not f1 in f3
2424

2525

2626
def test_feature_bp_overlap():
27-
f1 = Feature.from_string('chr1 12 50 feature1 10.0 +')
28-
f2 = Feature.from_string('chr1 40 60 feature2 10.0 -')
29-
f3 = Feature.from_string('chr1 60 80 feature2 10.0 -')
30-
f4 = Feature.from_string('chr2 60 80 feature2 10.0 -')
27+
f1 = Feature.from_string("chr1 12 50 feature1 10.0 +")
28+
f2 = Feature.from_string("chr1 40 60 feature2 10.0 -")
29+
f3 = Feature.from_string("chr1 60 80 feature2 10.0 -")
30+
f4 = Feature.from_string("chr2 60 80 feature2 10.0 -")
3131
assert f1.get_overlap_in_bp_with(f2) == 10
3232
assert f1.get_overlap_in_bp_with(f3) == 0
3333
assert f2.get_overlap_in_bp_with(f3) == 0

tests/test_math.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@
99
def test_masked_rho():
1010
x = np.array([1, 2, -1, 0.0, 4], dtype=float)
1111
y = np.array([1, 2, 0.0, -8, 4], dtype=float)
12-
assert pytest.approx(masked_rho(x, y, 0.0), 0.00001) == \
13-
np.corrcoef(np.array([1.0, 2.0, 4.0]), np.array([1.0, 2.0, 4.0]))[0, 1]
12+
assert (
13+
pytest.approx(masked_rho(x, y, 0.0), 0.00001)
14+
== np.corrcoef(np.array([1.0, 2.0, 4.0]), np.array([1.0, 2.0, 4.0]))[0, 1]
15+
)

0 commit comments

Comments
 (0)