Skip to content

Commit 0a59333

Browse files
author
Shoshana Berleant
committed
unused imports, pep8
1 parent 5709f05 commit 0a59333

File tree

2 files changed

+21
-31
lines changed

2 files changed

+21
-31
lines changed

nipype/algorithms/stats.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,16 @@
1111
>>> os.chdir(datadir)
1212
1313
'''
14-
from __future__ import print_function, division, unicode_literals, absolute_import
15-
from builtins import str, zip, range, open
14+
from __future__ import (print_function, division, unicode_literals,
15+
absolute_import)
16+
from builtins import str
1617

17-
import os
18-
import os.path as op
19-
20-
import nibabel as nb
2118
import numpy as np
22-
from scipy import linalg
23-
from scipy.special import legendre
2419
import nilearn.input_data as nl
2520

2621
from .. import logging
27-
from ..external.due import due, Doi, BibTeX
2822
from ..interfaces.base import (traits, TraitedSpec, BaseInterface,
29-
BaseInterfaceInputSpec, File, isdefined,
30-
InputMultiPath)
23+
BaseInterfaceInputSpec, File)
3124
IFLOG = logging.getLogger('interface')
3225

3326
class SignalExtractionInputSpec(BaseInterfaceInputSpec):

nipype/algorithms/tests/test_stats.py

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
22
# vi: set ft=python sts=4 ts=4 sw=4 et:
3-
import nipype
4-
from ...testing import (assert_equal, assert_true, assert_false, skipif, utils,
5-
assert_almost_equal, raises)
6-
from .. import stats
7-
83
import unittest
9-
import nibabel as nb
10-
import numpy as np
114
import os
125
import tempfile
136
import shutil
147

8+
import numpy as np
9+
10+
from ...testing import (assert_equal, utils, assert_almost_equal, raises)
11+
from .. import stats
12+
1513
class TestSignalExtraction(unittest.TestCase):
1614

1715
filenames = {
@@ -50,11 +48,10 @@ def test_signal_extraction(self):
5048
assert_equal(len(got), num_timepoints_wanted)
5149
# convert from string to float
5250
got = [[float(num) for num in row] for row in got]
53-
for time in range(len(got)):
54-
assert_equal(len(labels_wanted), len(got[time]))
55-
for segment in range(len(got[time])):
56-
assert_almost_equal(got[time][segment],
57-
wanted[time][segment], decimal=1)
51+
for i, time in enumerate(got):
52+
assert_equal(len(labels_wanted), len(time))
53+
for j, segment in enumerate(time):
54+
assert_almost_equal(segment, wanted[i][j], decimal=1)
5855

5956
@raises(ValueError)
6057
def test_signal_extraction_bad_class_labels(self):
@@ -67,18 +64,18 @@ def tearDown(self):
6764
os.chdir(self.orig_dir)
6865
shutil.rmtree(self.temp_dir)
6966

70-
fake_fmri_data = np.array([[[[ 2, -1, 4, -2, 3],
71-
[ 4, -2, -5, -1, 0]],
67+
fake_fmri_data = np.array([[[[2, -1, 4, -2, 3],
68+
[4, -2, -5, -1, 0]],
7269

73-
[[-2, 0, 1, 4, 4],
74-
[-5, 3, -3, 1, -5]]],
70+
[[-2, 0, 1, 4, 4],
71+
[-5, 3, -3, 1, -5]]],
7572

7673

77-
[[[ 2, -2, -1, -2, -5],
78-
[ 3, 0, 3, -5, -2]],
74+
[[[2, -2, -1, -2, -5],
75+
[3, 0, 3, -5, -2]],
7976

80-
[[-4, -2, -2, 1, -2],
81-
[ 3, 1, 4, -3, -2]]]])
77+
[[-4, -2, -2, 1, -2],
78+
[3, 1, 4, -3, -2]]]])
8279

8380
fake_label_data = np.array([[[1, 0],
8481
[3, 1]],

0 commit comments

Comments
 (0)