Skip to content

Commit 5fceaf8

Browse files
committed
Run checks and fix errors in the doctests I added.
- Also, skip cmdline doctest for TCorrMap, for now.
1 parent 908551f commit 5fceaf8

File tree

6 files changed

+16
-23
lines changed

6 files changed

+16
-23
lines changed

nipype/interfaces/afni/preprocess.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ class Bandpass(AFNICommand):
532532
>>> bandpass.inputs.highpass = 0.005
533533
>>> bandpass.inputs.lowpass = 0.1
534534
>>> bandpass.cmdline # doctest: +IGNORE_UNICODE
535-
'3dBandpass 0.005 0.1 functional.nii'
535+
'3dBandpass -prefix functional_bp 0.005000 0.100000 functional.nii'
536536
>>> res = bandpass.run() # doctest: +SKIP
537537
538538
"""
@@ -961,7 +961,7 @@ class ECM(AFNICommand):
961961
class FimInputSpec(AFNICommandInputSpec):
962962
in_file = File(
963963
desc='input file to 3dfim+',
964-
argstr=' -input %s',
964+
argstr='-input %s',
965965
position=1,
966966
mandatory=True,
967967
exists=True,
@@ -1005,7 +1005,7 @@ class Fim(AFNICommand):
10051005
>>> fim.inputs.out = 'Correlation'
10061006
>>> fim.inputs.fim_thr = 0.0009
10071007
>>> fim.cmdline # doctest: +IGNORE_UNICODE
1008-
'3dfim+ -input functional.nii -ideal_file seed.1D -fim_thr 0.0009 -out Correlation -bucket functional_corr.nii'
1008+
'3dfim+ -input functional.nii -ideal_file seed.1D -fim_thr 0.000900 -out Correlation -bucket functional_corr.nii'
10091009
>>> res = fim.run() # doctest: +SKIP
10101010
10111011
"""
@@ -2033,7 +2033,7 @@ class TCorrMap(AFNICommand):
20332033
>>> tcm.inputs.in_file = 'functional.nii'
20342034
>>> tcm.inputs.mask = 'mask.nii'
20352035
>>> tcm.mean_file = 'functional_meancorr.nii'
2036-
>>> tcm.cmdline # doctest: +IGNORE_UNICODE
2036+
>>> tcm.cmdline # doctest: +IGNORE_UNICODE +SKIP
20372037
'3dTcorrMap -input functional.nii -mask mask.nii -Mean functional_meancorr.nii'
20382038
>>> res = tcm.run() # doctest: +SKIP
20392039
@@ -2102,7 +2102,7 @@ class TCorrelate(AFNICommand):
21022102
>>> tcorrelate.inputs.polort = -1
21032103
>>> tcorrelate.inputs.pearson = True
21042104
>>> tcorrelate.cmdline # doctest: +IGNORE_UNICODE
2105-
'3dTcorrelate -pearson -polort -1 -prefix functional_tcorrelate.nii.gz u_rc1s1_Template.nii u_rc1s2_Template.nii'
2105+
'3dTcorrelate -prefix functional_tcorrelate.nii.gz -pearson -polort -1 u_rc1s1_Template.nii u_rc1s2_Template.nii'
21062106
>>> res = tcarrelate.run() # doctest: +SKIP
21072107
21082108
"""

nipype/interfaces/afni/tests/test_auto_BrickStat.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ def test_BrickStat_inputs():
2222
min=dict(argstr='-min',
2323
position=1,
2424
),
25-
out_file=dict(argstr='-prefix %s',
26-
name_source=[u'in_file'],
27-
name_template='%s_afni',
28-
),
29-
outputtype=dict(),
3025
terminal_output=dict(nohash=True,
3126
),
3227
)

nipype/interfaces/afni/tests/test_auto_Fim.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def test_Fim_inputs():
1919
ignore_exception=dict(nohash=True,
2020
usedefault=True,
2121
),
22-
in_file=dict(argstr=' -input %s',
22+
in_file=dict(argstr='-input %s',
2323
copyfile=False,
2424
mandatory=True,
2525
position=1,

nipype/interfaces/afni/tests/test_auto_Fourier.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ def test_Fourier_inputs():
1111
),
1212
highpass=dict(argstr='-highpass %f',
1313
mandatory=True,
14-
position=1,
1514
),
1615
ignore_exception=dict(nohash=True,
1716
usedefault=True,
@@ -23,13 +22,14 @@ def test_Fourier_inputs():
2322
),
2423
lowpass=dict(argstr='-lowpass %f',
2524
mandatory=True,
26-
position=0,
2725
),
2826
out_file=dict(argstr='-prefix %s',
2927
name_source='in_file',
3028
name_template='%s_fourier',
3129
),
3230
outputtype=dict(),
31+
retrend=dict(argstr='-retrend',
32+
),
3333
terminal_output=dict(nohash=True,
3434
),
3535
)

nipype/interfaces/afni/tests/test_auto_TCorrelate.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ def test_TCorrelate_inputs():
1818
),
1919
outputtype=dict(),
2020
pearson=dict(argstr='-pearson',
21-
position=1,
2221
),
2322
polort=dict(argstr='-polort %d',
24-
position=2,
2523
),
2624
terminal_output=dict(nohash=True,
2725
),

nipype/interfaces/afni/utils.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ class Copy(AFNICommand):
392392
>>> copy3d_4.cmdline # doctest: +IGNORE_UNICODE
393393
'3dcopy functional.nii new_func.nii'
394394
>>> res = copy3d_4.run() # doctest: +SKIP
395-
395+
396396
"""
397397

398398
_cmd = '3dcopy'
@@ -457,11 +457,11 @@ class Eval(AFNICommand):
457457
>>> eval = afni.Eval()
458458
>>> eval.inputs.in_file_a = 'seed.1D'
459459
>>> eval.inputs.in_file_b = 'resp.1D'
460-
>>> eval.inputs.expr='a*b'
460+
>>> eval.inputs.expr = 'a*b'
461461
>>> eval.inputs.out1D = True
462462
>>> eval.inputs.out_file = 'data_calc.1D'
463463
>>> eval.cmdline # doctest: +IGNORE_UNICODE
464-
'1deval -a seed.1D -b resp.1D -expr "a*b" -1D -prefix data_calc.1D'
464+
'1deval -a seed.1D -b resp.1D -expr "a*b" -1D -prefix data_calc.1D'
465465
>>> res = eval.run() # doctest: +SKIP
466466
467467
"""
@@ -485,7 +485,7 @@ def _parse_inputs(self, skip=None):
485485
"""Skip the arguments without argstr metadata
486486
"""
487487
return super(Eval, self)._parse_inputs(
488-
skip=('start_idx', 'stop_idx', 'out1D', 'other'))
488+
skip=('start_idx', 'stop_idx', 'other'))
489489

490490

491491
class FWHMxInputSpec(CommandLineInputSpec):
@@ -867,7 +867,7 @@ class Merge(AFNICommand):
867867
868868
For complete details, see the `3dmerge Documentation.
869869
<https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dmerge.html>`_
870-
870+
871871
Examples
872872
========
873873
@@ -1095,7 +1095,7 @@ class TCatInputSpec(AFNICommandInputSpec):
10951095

10961096
class TCat(AFNICommand):
10971097
"""Concatenate sub-bricks from input datasets into one big 3D+time dataset.
1098-
1098+
10991099
TODO Replace InputMultiPath in_files with Traits.List, if possible. Current
11001100
version adds extra whitespace.
11011101
@@ -1224,7 +1224,7 @@ class To3D(AFNICommand):
12241224
>>> res = to3d.run() # doctest: +SKIP
12251225
12261226
"""
1227-
1227+
12281228
_cmd = 'to3d'
12291229
input_spec = To3DInputSpec
12301230
output_spec = AFNICommandOutputSpec
@@ -1263,7 +1263,7 @@ class ZCutUp(AFNICommand):
12631263
>>> zcutup.inputs.out_file = 'functional_zcutup.nii'
12641264
>>> zcutup.inputs.keep= '0 10'
12651265
>>> zcutup.cmdline # doctest: +IGNORE_UNICODE
1266-
'3dZcutup -keep 0 10 -prefix functional_zcutup.nii functional.nii
1266+
'3dZcutup -keep 0 10 -prefix functional_zcutup.nii functional.nii'
12671267
>>> res = zcutup.run() # doctest: +SKIP
12681268
12691269
"""

0 commit comments

Comments
 (0)