Skip to content

Commit 144fca3

Browse files
committed
Merge branch 'master' of https://github.com/nipy/nipype
2 parents 422c04c + 27dc5cb commit 144fca3

File tree

4 files changed

+17
-15
lines changed

4 files changed

+17
-15
lines changed

nipype/algorithms/tests/test_CompCor.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,15 @@ def test_compcor_bad_input_shapes(self):
138138
data_file = utils.save_toy_nii(np.zeros(data_shape), 'temp.nii')
139139
interface = CompCor(
140140
realigned_file=data_file, mask_files=self.mask_files[0])
141-
with pytest.raises(ValueError, message="Dimension mismatch"):
142-
interface.run()
141+
with pytest.raises(ValueError):
142+
interface.run() # Dimension mismatch
143143

144144
def test_tcompcor_bad_input_dim(self):
145145
bad_dims = (2, 2, 2)
146146
data_file = utils.save_toy_nii(np.zeros(bad_dims), 'temp.nii')
147147
interface = TCompCor(realigned_file=data_file)
148-
with pytest.raises(ValueError, message='Not a 4D file'):
149-
interface.run()
148+
with pytest.raises(ValueError):
149+
interface.run() # Not a 4D file
150150

151151
def test_tcompcor_merge_intersect_masks(self):
152152
for method in ['union', 'intersect']:
@@ -175,8 +175,8 @@ def test_tcompcor_index_mask(self):
175175
def test_tcompcor_multi_mask_no_index(self):
176176
interface = TCompCor(
177177
realigned_file=self.realigned_file, mask_files=self.mask_files)
178-
with pytest.raises(ValueError, message='more than one mask file'):
179-
interface.run()
178+
with pytest.raises(ValueError):
179+
interface.run() # more than one mask file
180180

181181
def run_cc(self,
182182
ccinterface,

nipype/interfaces/dipy/tracks.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@
2020
if HAVE_DIPY and LooseVersion(dipy_version()) >= LooseVersion('0.15'):
2121

2222
from dipy.workflows.segment import RecoBundlesFlow, LabelsBundlesFlow
23-
from dipy.workflows.tracking import DetTrackPAMFlow
23+
try:
24+
from dipy.workflows.tracking import LocalFiberTrackingPAMFlow as DetTrackFlow
25+
except ImportError: # different name in 0.15
26+
from dipy.workflows.tracking import DetTrackPAMFlow as DetTrackFlow
2427

2528
RecoBundles = dipy_to_nipype_interface("RecoBundles", RecoBundlesFlow)
2629
LabelsBundles = dipy_to_nipype_interface("LabelsBundles",
2730
LabelsBundlesFlow)
2831
DeterministicTracking = dipy_to_nipype_interface("DeterministicTracking",
29-
DetTrackPAMFlow)
32+
DetTrackFlow)
3033

3134
else:
3235
IFLOGGER.info("We advise you to upgrade DIPY version. This upgrade will"

nipype/testing/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
template = funcfile
1717
transfm = funcfile
1818

19-
from . import decorators as dec
19+
from . import decorators
2020
from .utils import package_check, TempFATFS
2121

22-
skipif = dec.skipif
22+
skipif = decorators.dec.skipif
2323

2424

2525
def example_data(infile='functional.nii'):

nipype/testing/decorators.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
"""
55
Extend numpy's decorators to use nipype's gui and data labels.
66
"""
7-
8-
from numpy.testing.decorators import knownfailureif, skipif
7+
from numpy.testing import dec
98

109
from nibabel.data import DataError
1110

@@ -81,19 +80,19 @@ def needs_review(msg):
8180
"""
8281

8382
def skip_func(func):
84-
return skipif(True, msg)(func)
83+
return dec.skipif(True, msg)(func)
8584

8685
return skip_func
8786

8887

8988
# Easier version of the numpy knownfailure
9089
def knownfailure(f):
91-
return knownfailureif(True)(f)
90+
return dec.knownfailureif(True)(f)
9291

9392

9493
def if_datasource(ds, msg):
9594
try:
9695
ds.get_filename()
9796
except DataError:
98-
return skipif(True, msg)
97+
return dec.skipif(True, msg)
9998
return lambda f: f

0 commit comments

Comments
 (0)