File tree 7 files changed +10
-32
lines changed
7 files changed +10
-32
lines changed Original file line number Diff line number Diff line change @@ -326,6 +326,4 @@ def _cmd_prefix(self):
326
326
327
327
def no_afni ():
328
328
"""Check whether AFNI is not available."""
329
- if Info .version () is None :
330
- return True
331
- return False
329
+ return Info .version () is None
Original file line number Diff line number Diff line change @@ -269,7 +269,4 @@ def no_freesurfer():
269
269
used with skipif to skip tests that will
270
270
fail if FreeSurfer is not installed"""
271
271
272
- if Info .version () is None :
273
- return True
274
- else :
275
- return False
272
+ return Info .version () is None
Original file line number Diff line number Diff line change @@ -262,10 +262,7 @@ def no_fsl():
262
262
used with skipif to skip tests that will
263
263
fail if FSL is not installed"""
264
264
265
- if Info .version () is None :
266
- return True
267
- else :
268
- return False
265
+ return Info .version () is None
269
266
270
267
271
268
def no_fsl_course_data ():
Original file line number Diff line number Diff line change @@ -52,10 +52,7 @@ def func_is_3d(in_file):
52
52
else :
53
53
img = load (in_file )
54
54
shape = img .shape
55
- if len (shape ) == 3 or (len (shape ) == 4 and shape [3 ] == 1 ):
56
- return True
57
- else :
58
- return False
55
+ return len (shape ) == 3 or len (shape ) == 4 and shape [3 ] == 1
59
56
60
57
61
58
def get_first_3dfile (in_files ):
@@ -254,10 +251,7 @@ def no_spm():
254
251
used with pytest.mark.skipif decorator to skip tests
255
252
that will fail if spm is not installed"""
256
253
257
- if "NIPYPE_NO_MATLAB" in os .environ or Info .version () is None :
258
- return True
259
- else :
260
- return False
254
+ return "NIPYPE_NO_MATLAB" in os .environ or Info .version () is None
261
255
262
256
263
257
class SPMCommandInputSpec (BaseInterfaceInputSpec ):
Original file line number Diff line number Diff line change @@ -55,9 +55,7 @@ def _is_pending(self, taskid):
55
55
iflogger .setLevel (logging .getLevelName ("CRITICAL" ))
56
56
result = cmd .run (ignore_exception = True )
57
57
iflogger .setLevel (oldlevel )
58
- if result .runtime .stdout .count ("\n %d" % taskid ):
59
- return True
60
- return False
58
+ return bool (result .runtime .stdout .count ("\n %d" % taskid ))
61
59
62
60
def _submit_batchtask (self , scriptfile , node ):
63
61
cmd = CommandLine (
Original file line number Diff line number Diff line change @@ -54,10 +54,9 @@ def _is_pending(self, taskid):
54
54
result = cmd .run (ignore_exception = True )
55
55
iflogger .setLevel (oldlevel )
56
56
# logger.debug(result.runtime.stdout)
57
- if "DONE" in result .runtime .stdout or "EXIT" in result .runtime .stdout :
58
- return False
59
- else :
60
- return True
57
+ return (
58
+ "DONE" not in result .runtime .stdout and "EXIT" not in result .runtime .stdout
59
+ )
61
60
62
61
def _submit_batchtask (self , scriptfile , node ):
63
62
cmd = CommandLine (
Original file line number Diff line number Diff line change @@ -87,12 +87,7 @@ def is_container(item):
87
87
True if container
88
88
False if not (eg string)
89
89
"""
90
- if isinstance (item , str ):
91
- return False
92
- elif hasattr (item , "__iter__" ):
93
- return True
94
- else :
95
- return False
90
+ return not isinstance (item , str ) and hasattr (item , "__iter__" )
96
91
97
92
98
93
def container_to_string (cont ):
You can’t perform that action at this time.
0 commit comments