File tree Expand file tree Collapse file tree 7 files changed +10
-32
lines changed Expand file tree Collapse file tree 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):
326326
327327def no_afni ():
328328 """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():
269269 used with skipif to skip tests that will
270270 fail if FreeSurfer is not installed"""
271271
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():
262262 used with skipif to skip tests that will
263263 fail if FSL is not installed"""
264264
265- if Info .version () is None :
266- return True
267- else :
268- return False
265+ return Info .version () is None
269266
270267
271268def no_fsl_course_data ():
Original file line number Diff line number Diff line change @@ -52,10 +52,7 @@ def func_is_3d(in_file):
5252 else :
5353 img = load (in_file )
5454 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
5956
6057
6158def get_first_3dfile (in_files ):
@@ -254,10 +251,7 @@ def no_spm():
254251 used with pytest.mark.skipif decorator to skip tests
255252 that will fail if spm is not installed"""
256253
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
261255
262256
263257class SPMCommandInputSpec (BaseInterfaceInputSpec ):
Original file line number Diff line number Diff line change @@ -55,9 +55,7 @@ def _is_pending(self, taskid):
5555 iflogger .setLevel (logging .getLevelName ("CRITICAL" ))
5656 result = cmd .run (ignore_exception = True )
5757 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 ))
6159
6260 def _submit_batchtask (self , scriptfile , node ):
6361 cmd = CommandLine (
Original file line number Diff line number Diff line change @@ -54,10 +54,9 @@ def _is_pending(self, taskid):
5454 result = cmd .run (ignore_exception = True )
5555 iflogger .setLevel (oldlevel )
5656 # 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+ )
6160
6261 def _submit_batchtask (self , scriptfile , node ):
6362 cmd = CommandLine (
Original file line number Diff line number Diff line change @@ -87,12 +87,7 @@ def is_container(item):
8787 True if container
8888 False if not (eg string)
8989 """
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__" )
9691
9792
9893def container_to_string (cont ):
You can’t perform that action at this time.
0 commit comments