Skip to content

Commit ff36588

Browse files
authored
Merge pull request #1746 from djarecka/trailing_spaces
removing trailing spaces
2 parents 7e6c3c9 + 831061d commit ff36588

26 files changed

+106
-106
lines changed

nipype/algorithms/confounds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ def compute_dvars(in_file, in_mask, remove_zerovariance=False):
668668
warnings.filterwarnings('error')
669669

670670
# voxelwise standardization
671-
diff_vx_stdz = func_diff / np.array([diff_sdhat] * func_diff.shape[-1]).T
671+
diff_vx_stdz = func_diff / np.array([diff_sdhat] * func_diff.shape[-1]).T
672672
dvars_vx_stdz = diff_vx_stdz.std(axis=0, ddof=1)
673673

674674
return (dvars_stdz, dvars_nstd, dvars_vx_stdz)

nipype/algorithms/tests/test_compcor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class TestCompCor():
1616
filenames = {'functionalnii': 'compcorfunc.nii',
1717
'masknii': 'compcormask.nii',
1818
'components_file': None}
19-
19+
2020
@pytest.fixture(autouse=True)
2121
def setup_class(self, tmpdir):
2222
# setup

nipype/algorithms/tests/test_mesh_ops.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def test_ident_distances(tmpdir):
2525
dist_ident.inputs.out_file = os.path.join(tempdir, 'distance.npy')
2626
res = dist_ident.run()
2727
assert res.outputs.distance == 0.0
28-
28+
2929
dist_ident.inputs.weighting = 'area'
3030
res = dist_ident.run()
3131
assert res.outputs.distance == 0.0
@@ -35,23 +35,23 @@ def test_ident_distances(tmpdir):
3535
def test_trans_distances(tmpdir):
3636
tempdir = str(tmpdir)
3737
os.chdir(tempdir)
38-
38+
3939
from ...interfaces.vtkbase import tvtk
40-
40+
4141
in_surf = example_data('surf01.vtk')
4242
warped_surf = os.path.join(tempdir, 'warped.vtk')
43-
43+
4444
inc = np.array([0.7, 0.3, -0.2])
45-
45+
4646
r1 = tvtk.PolyDataReader(file_name=in_surf)
4747
vtk1 = VTKInfo.vtk_output(r1)
4848
r1.update()
4949
vtk1.points = np.array(vtk1.points) + inc
50-
50+
5151
writer = tvtk.PolyDataWriter(file_name=warped_surf)
5252
VTKInfo.configure_input_data(writer, vtk1)
5353
writer.write()
54-
54+
5555
dist = m.ComputeMeshWarp()
5656
dist.inputs.surface1 = in_surf
5757
dist.inputs.surface2 = warped_surf
@@ -79,10 +79,10 @@ def test_meshwarpmaths(tmpdir):
7979

8080
@pytest.mark.skipif(not VTKInfo.no_tvtk(), reason="tvtk is installed")
8181
def test_importerror():
82-
with pytest.raises(ImportError):
82+
with pytest.raises(ImportError):
8383
m.ComputeMeshWarp()
8484

85-
with pytest.raises(ImportError):
85+
with pytest.raises(ImportError):
8686
m.WarpPoints()
8787

8888
with pytest.raises(ImportError):

nipype/algorithms/tests/test_modelgen.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ def test_modelgen_sparse(tmpdir):
152152
assert len(res.outputs.session_info[0]['regress']) == 1
153153
s.inputs.use_temporal_deriv = True
154154
res = s.run()
155-
155+
156156
assert len(res.outputs.session_info[0]['regress']) == 2
157157
npt.assert_almost_equal(res.outputs.session_info[0]['regress'][0]['val'][0], 0.016675298129743384)
158158
npt.assert_almost_equal(res.outputs.session_info[1]['regress'][1]['val'][5], 0.007671459162258378)
159-
159+

nipype/algorithms/tests/test_overlap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def check_close(val1, val2):
2626
overlap.inputs.volume2 = in1
2727
res = overlap.run()
2828
check_close(res.outputs.jaccard, 1.0)
29-
29+
3030
overlap = Overlap()
3131
overlap.inputs.volume1 = in1
3232
overlap.inputs.volume2 = in2

nipype/interfaces/freesurfer/tests/test_preprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def test_robustregister(create_files_in_directory):
5858
assert reg2.cmdline == ('mri_robust_register --halfdst %s_halfway.nii --lta foo.lta '
5959
'--sat 3.0000 --mov %s --dst %s'
6060
% (os.path.join(outdir, filelist[1][:-4]), filelist[0], filelist[1]))
61-
61+
6262

6363
@pytest.mark.skipif(freesurfer.no_freesurfer(), reason="freesurfer is not installed")
6464
def test_fitmsparams(create_files_in_directory):

nipype/interfaces/fsl/tests/test_base.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import pytest
1111

12-
@pytest.mark.skipif(no_fsl(), reason="fsl is not installed")
12+
@pytest.mark.skipif(no_fsl(), reason="fsl is not installed")
1313
def test_fslversion():
1414
ver = fsl.Info.version()
1515
ver = ver.split('.')
@@ -27,8 +27,8 @@ def test_outputtype_to_ext():
2727
for ftype, ext in fsl.Info.ftypes.items():
2828
res = fsl.Info.output_type_to_ext(ftype)
2929
assert res == ext
30-
31-
with pytest.raises(KeyError):
30+
31+
with pytest.raises(KeyError):
3232
fsl.Info.output_type_to_ext('JUNK')
3333

3434

@@ -60,11 +60,11 @@ def test_FSLCommand2():
6060

6161

6262
@pytest.mark.skipif(no_fsl(), reason="fsl is not installed")
63-
@pytest.mark.parametrize("args, desired_name",
64-
[({}, {"file": 'foo.nii.gz'}), # just the filename
65-
({"suffix": '_brain'}, {"file": 'foo_brain.nii.gz'}), # filename with suffix
66-
({"suffix": '_brain', "cwd": '/data'},
67-
{"dir": '/data', "file": 'foo_brain.nii.gz'}), # filename with suffix and working directory
63+
@pytest.mark.parametrize("args, desired_name",
64+
[({}, {"file": 'foo.nii.gz'}), # just the filename
65+
({"suffix": '_brain'}, {"file": 'foo_brain.nii.gz'}), # filename with suffix
66+
({"suffix": '_brain', "cwd": '/data'},
67+
{"dir": '/data', "file": 'foo_brain.nii.gz'}), # filename with suffix and working directory
6868
({"suffix": '_brain.mat', "change_ext": False}, {"file": 'foo_brain.mat'}) # filename with suffix and no file extension change
6969
])
7070
def test_gen_fname(args, desired_name):

nipype/interfaces/fsl/tests/test_dti.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def test_dtifit2(create_files_in_directory):
7070
filelist[1])
7171

7272

73-
@pytest.mark.xfail(reason="These tests are skipped until we clean up some of this code")
73+
@pytest.mark.xfail(reason="These tests are skipped until we clean up some of this code")
7474
def test_randomise2():
7575

7676
rand = fsl.Randomise()
@@ -79,7 +79,7 @@ def test_randomise2():
7979
assert rand.cmd == 'randomise'
8080

8181
# test raising error with mandatory args absent
82-
with pytest.raises(ValueError):
82+
with pytest.raises(ValueError):
8383
rand.run()
8484

8585
# .inputs based parameters setting
@@ -155,7 +155,7 @@ def test_Randomise_parallel():
155155
assert rand.cmd == 'randomise_parallel'
156156

157157
# test raising error with mandatory args absent
158-
with pytest.raises(ValueError):
158+
with pytest.raises(ValueError):
159159
rand.run()
160160

161161
# .inputs based parameters setting
@@ -269,7 +269,7 @@ def test_Vec_reg():
269269
assert vrg.cmd == 'vecreg'
270270

271271
# test raising error with mandatory args absent
272-
with pytest.raises(ValueError):
272+
with pytest.raises(ValueError):
273273
vrg.run()
274274

275275
# .inputs based parameters setting
@@ -330,7 +330,7 @@ def test_Find_the_biggest():
330330
assert fbg.cmd == 'find_the_biggest'
331331

332332
# test raising error with mandatory args absent
333-
with pytest.raises(ValueError):
333+
with pytest.raises(ValueError):
334334
fbg.run()
335335

336336
# .inputs based parameters setting
@@ -355,12 +355,12 @@ def test_tbss_skeleton(create_files_in_directory):
355355
skeletor = fsl.TractSkeleton()
356356

357357
files, newdir = create_files_in_directory
358-
358+
359359
# Test the underlying command
360360
assert skeletor.cmd == "tbss_skeleton"
361361

362362
# It shouldn't run yet
363-
with pytest.raises(ValueError):
363+
with pytest.raises(ValueError):
364364
skeletor.run()
365365

366366
# Test the most basic way to use it
@@ -379,7 +379,7 @@ def test_tbss_skeleton(create_files_in_directory):
379379
bones = fsl.TractSkeleton(in_file="a.nii", project_data=True)
380380

381381
# This should error
382-
with pytest.raises(ValueError):
382+
with pytest.raises(ValueError):
383383
bones.run()
384384

385385
# But we can set what we need

nipype/interfaces/fsl/tests/test_epi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def test_eddy_correct2(create_files_in_directory):
4747
assert eddy.cmd == 'eddy_correct'
4848

4949
# test raising error with mandatory args absent
50-
with pytest.raises(ValueError):
50+
with pytest.raises(ValueError):
5151
eddy.run()
5252

5353
# .inputs based parameters setting

nipype/interfaces/fsl/tests/test_maths.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def create_files_in_directory(request):
4949
nb.save(nb.Nifti1Image(img, np.eye(4), hdr),
5050
os.path.join(testdir, f))
5151

52-
out_ext = Info.output_type_to_ext(Info.output_type())
52+
out_ext = Info.output_type_to_ext(Info.output_type())
5353

5454
def fin():
5555
if os.path.exists(testdir):
@@ -186,7 +186,7 @@ def test_meanimage(create_files_in_directory):
186186
meaner = fsl.MeanImage(in_file="a.nii")
187187
assert meaner.cmdline == "fslmaths a.nii -Tmean %s" % os.path.join(testdir, "a_mean%s" % out_ext)
188188

189-
189+
190190
@pytest.mark.skipif(no_fsl(), reason="fsl is not installed")
191191
def test_stdimage(create_files_in_directory):
192192
files, testdir, out_ext = create_files_in_directory
@@ -209,7 +209,7 @@ def test_stdimage(create_files_in_directory):
209209
# Test the auto naming
210210
stder = fsl.StdImage(in_file="a.nii")
211211
#NOTE_dj, FAIL: this is failing (even the original version of the test with pytest)
212-
#NOTE_dj: not sure if this should pass, it uses cmdline from interface.base.CommandLine
212+
#NOTE_dj: not sure if this should pass, it uses cmdline from interface.base.CommandLine
213213
#assert stder.cmdline == "fslmaths a.nii -Tstd %s"%os.path.join(testdir, "a_std.nii")
214214

215215

@@ -248,7 +248,7 @@ def test_smooth(create_files_in_directory):
248248
assert smoother.cmd == "fslmaths"
249249

250250
# Test that smoothing kernel is mandatory
251-
with pytest.raises(ValueError):
251+
with pytest.raises(ValueError):
252252
smoother.run()
253253

254254
# Test smoothing kernels
@@ -276,7 +276,7 @@ def test_mask(create_files_in_directory):
276276
assert masker.cmd == "fslmaths"
277277

278278
# Test that the mask image is mandatory
279-
with pytest.raises(ValueError):
279+
with pytest.raises(ValueError):
280280
masker.run()
281281

282282
# Test setting the mask image
@@ -299,7 +299,7 @@ def test_dilation(create_files_in_directory):
299299
assert diller.cmd == "fslmaths"
300300

301301
# Test that the dilation operation is mandatory
302-
with pytest.raises(ValueError):
302+
with pytest.raises(ValueError):
303303
diller.run()
304304

305305
# Test the different dilation operations
@@ -361,7 +361,7 @@ def test_spatial_filter(create_files_in_directory):
361361
assert filter.cmd == "fslmaths"
362362

363363
# Test that it fails without an operation
364-
with pytest.raises(ValueError):
364+
with pytest.raises(ValueError):
365365
filter.run()
366366

367367
# Test the different operations
@@ -385,7 +385,7 @@ def test_unarymaths(create_files_in_directory):
385385
assert maths.cmd == "fslmaths"
386386

387387
# Test that it fails without an operation
388-
with pytest.raises(ValueError):
388+
with pytest.raises(ValueError):
389389
maths.run()
390390

391391
# Test the different operations
@@ -488,4 +488,4 @@ def test_tempfilt(create_files_in_directory):
488488
"fslmaths a.nii -bptf 64.000000 -1.000000 %s" % os.path.join(testdir, "a_filt%s" % out_ext)
489489

490490

491-
491+

0 commit comments

Comments
 (0)