Skip to content

Commit 8776b55

Browse files
DylanDylan
Dylan
authored and
Dylan
committed
[FIX] Add ellipsis to doctests. CMD if path not found
1 parent 1575d2d commit 8776b55

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

nipype/interfaces/afni/base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,10 @@ class AFNIPythonCommandInputSpec(CommandLineInputSpec):
295295
class AFNIPythonCommand(AFNICommand):
296296
@property
297297
def cmd(self):
298-
return spawn.find_executable(super(AFNIPythonCommand, self).cmd)
298+
if spawn.find_executable(super(AFNIPythonCommand, self).cmd) != '':
299+
return spawn.find_executable(super(AFNIPythonCommand, self).cmd)
300+
else:
301+
return super(AFNIPythonCommand, self).cmd
299302

300303
@property
301304
def cmdline(self):

nipype/interfaces/afni/preprocess.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ class AlignEpiAnatPy(AFNIPythonCommand):
168168
>>> al_ea.inputs.volreg = 'off'
169169
>>> al_ea.inputs.tshift = 'off'
170170
>>> al_ea.inputs.save_skullstrip = True
171-
>>> al_ea.cmdline # doctest: +ALLOW_UNICODE
172-
'python2 /usr/lib/afni/bin/align_epi_anat.py -anat structural.nii -epi_base 0 -epi_strip 3dAutomask -epi functional.nii -save_skullstrip -suffix _al -tshift off -volreg off'
171+
>>> al_ea.cmdline # doctest: +ALLOW_UNICODE +ELLIPSIS
172+
'python2 ...align_epi_anat.py -anat structural.nii -epi_base 0 -epi_strip 3dAutomask -epi functional.nii -save_skullstrip -suffix _al -tshift off -volreg off'
173173
>>> res = allineate.run() # doctest: +SKIP
174174
"""
175175
_cmd = 'align_epi_anat.py'

nipype/interfaces/afni/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,8 +1554,8 @@ class OneDToolPy(AFNIPythonCommand):
15541554
>>> odt.inputs.set_nruns = 3
15551555
>>> odt.inputs.demean = True
15561556
>>> odt.inputs.out_file = 'motion_dmean.1D'
1557-
>>> odt.cmdline # doctest: +ALLOW_UNICODE
1558-
'python2 /usr/lib/afni/bin/1d_tool.py -demean -infile f1.1D -write motion_dmean.1D -set_nruns 3'
1557+
>>> odt.cmdline # doctest: +ALLOW_UNICODE +ELLIPSIS
1558+
'python2 ...1d_tool.py -demean -infile f1.1D -write motion_dmean.1D -set_nruns 3'
15591559
>>> res = odt.run() # doctest: +SKIP
15601560
"""
15611561

0 commit comments

Comments
 (0)