Skip to content

Commit 728bc1b

Browse files
committed
fix test
1 parent 31bc311 commit 728bc1b

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

nipype/algorithms/tests/test_stats.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_ActivationCount(tmpdir):
1515
nb.Nifti1Image(np.random.normal(size=(5, 5, 5)),
1616
np.eye(4)).to_filename(fname)
1717

18-
acm = ActivationCount(in_files=in_files)
18+
acm = ActivationCount(in_files=in_files, threshold=1.65)
1919
res = acm.run()
2020
diff = nb.load(res.outputs.out_file)
2121
pos = nb.load(res.outputs.acm_pos)
@@ -24,10 +24,10 @@ def test_ActivationCount(tmpdir):
2424

2525

2626
@pytest.mark.parametrize("threshold, above_thresh", [
27-
(1, 15.865), # above one standard deviation (one side)
28-
(2, 2.275), # above two standard deviations (one side)
29-
(3, 0.135) # above three standard deviations (one side)
30-
])
27+
(1, 15.865), # above one standard deviation (one side)
28+
(2, 2.275), # above two standard deviations (one side)
29+
(3, 0.135) # above three standard deviations (one side)
30+
])
3131
def test_ActivationCount_normaldistr(tmpdir, threshold, above_thresh):
3232
tmpdir.chdir()
3333
in_files = ['{:d}.nii'.format(i) for i in range(3)]
@@ -39,5 +39,7 @@ def test_ActivationCount_normaldistr(tmpdir, threshold, above_thresh):
3939
res = acm.run()
4040
pos = nb.load(res.outputs.acm_pos)
4141
neg = nb.load(res.outputs.acm_neg)
42-
assert np.isclose(pos.get_data().mean(), above_thresh*1.e-2, rtol=0.1, atol=1.e-4)
43-
assert np.isclose(neg.get_data().mean(), above_thresh*1.e-2, rtol=0.1, atol=1.e-4)
42+
assert np.isclose(pos.get_data().mean(),
43+
above_thresh * 1.e-2, rtol=0.1, atol=1.e-4)
44+
assert np.isclose(neg.get_data().mean(),
45+
above_thresh * 1.e-2, rtol=0.1, atol=1.e-4)

0 commit comments

Comments
 (0)