Skip to content

Commit f28d822

Browse files
committed
FIX: PEP8 - E712 comparison to True/False should be 'if cond is True/False:' or 'if (not) cond:'
1 parent 46635e5 commit f28d822

File tree

7 files changed

+15
-15
lines changed

7 files changed

+15
-15
lines changed

nipype/fixes/numpy/testing/nosetester.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def prepare_test_args(self, label='fast', verbose=1, extra_argv=None,
245245
plugins += [p() for p in nose.plugins.builtin.plugins]
246246
# add doctesting if required
247247
doctest_argv = '--with-doctest' in argv
248-
if doctests == False and doctest_argv:
248+
if doctests is False and doctest_argv:
249249
doctests = True
250250
plug = self._get_custom_doctester()
251251
if plug is None:

nipype/interfaces/cmtk/parcellation.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def create_roi(subject_id, subjects_dir, fs_dir, parcellation_name, dilation):
273273

274274
iflogger.info("[ DONE ]")
275275
# dilate cortical regions
276-
if (dilation == True):
276+
if dilation is True:
277277
iflogger.info("Dilating cortical regions...")
278278
# loop throughout all the voxels belonging to the aseg GM volume
279279
for j in range(xx.size):
@@ -463,7 +463,7 @@ def crop_and_move_datasets(subject_id, subjects_dir, fs_dir, parcellation_name,
463463

464464
ds.append((op.abspath('ROI_%s.nii.gz' % parcellation_name),
465465
op.abspath('ROI_HR_th.nii.gz')))
466-
if(dilation == True):
466+
if dilation is True:
467467
ds.append((op.abspath('ROIv_%s.nii.gz' % parcellation_name),
468468
op.abspath('ROIv_HR_th.nii.gz')))
469469
orig = op.join(fs_dir, 'mri', 'orig', '001.mgz')
@@ -588,7 +588,7 @@ def _list_outputs(self):
588588
else:
589589
outputs['roi_file'] = op.abspath(
590590
self._gen_outfilename('nii.gz', 'ROI'))
591-
if(self.inputs.dilation == True):
591+
if self.inputs.dilation is True:
592592
outputs['roiv_file'] = op.abspath(self._gen_outfilename(
593593
'nii.gz', 'ROIv'))
594594
outputs['white_matter_mask_file'] = op.abspath('fsmask_1mm.nii.gz')
@@ -597,7 +597,7 @@ def _list_outputs(self):
597597
outputs['aseg_file'] = op.abspath('aseg.nii.gz')
598598
outputs['roi_file_in_structural_space'] = op.abspath(
599599
'ROI_HR_th.nii.gz')
600-
if(self.inputs.dilation == True):
600+
if self.inputs.dilation is True:
601601
outputs['dilated_roi_file_in_structural_space'] = op.abspath(
602602
'ROIv_HR_th.nii.gz')
603603
return outputs

nipype/interfaces/freesurfer/preprocess.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1003,8 +1003,8 @@ class ApplyVolTransform(FSCommand):
10031003
def _get_outfile(self):
10041004
outfile = self.inputs.transformed_file
10051005
if not isdefined(outfile):
1006-
if self.inputs.inverse == True:
1007-
if self.inputs.fs_target == True:
1006+
if self.inputs.inverse is True:
1007+
if self.inputs.fs_target is True:
10081008
src = 'orig.mgz'
10091009
else:
10101010
src = self.inputs.target_file

nipype/interfaces/fsl/dti.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ def _list_outputs(self):
836836

837837
outputs['log'] = os.path.abspath(os.path.join(out_dir, 'probtrackx.log'))
838838
# utputs['way_total'] = os.path.abspath(os.path.join(out_dir, 'waytotal'))
839-
if isdefined(self.inputs.opd == True):
839+
if isdefined(self.inputs.opd is True):
840840
if isinstance(self.inputs.seed, list) and isinstance(self.inputs.seed[0], list):
841841
outputs['fdt_paths'] = []
842842
for seed in self.inputs.seed:

nipype/interfaces/slicer/generate_classes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def generate_class(module, launcher, strip_module_name_prefix=True, redirect_x=F
227227
param.nodeName.replace('-vector', '')]]
228228
else:
229229
values = [typesDict[param.nodeName.replace('-vector', '')]]
230-
if mipav_hacks == True:
230+
if mipav_hacks is True:
231231
traitsParams["sep"] = ";"
232232
else:
233233
traitsParams["sep"] = ','

nipype/pipeline/plugins/sgegraph.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ def node_completed_status(checknode):
1616
:return: boolean value True indicates that the node does not need to be run.
1717
"""
1818
""" TODO: place this in the base.py file and refactor """
19-
node_state_does_not_require_overwrite = (checknode.overwrite == False or
20-
(checknode.overwrite == None and
21-
not checknode._interface.always_run)
19+
node_state_does_not_require_overwrite = (checknode.overwrite is False or
20+
(checknode.overwrite is None and not
21+
checknode._interface.always_run)
2222
)
2323
hash_exists = False
2424
try:

nipype/pipeline/plugins/slurmgraph.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ def node_completed_status(checknode):
1616
:return: boolean value True indicates that the node does not need to be run.
1717
"""
1818
""" TODO: place this in the base.py file and refactor """
19-
node_state_does_not_require_overwrite = (checknode.overwrite == False or
20-
(checknode.overwrite == None and
21-
not checknode._interface.always_run)
19+
node_state_does_not_require_overwrite = (checknode.overwrite is False or
20+
(checknode.overwrite is None and not
21+
checknode._interface.always_run)
2222
)
2323
hash_exists = False
2424
try:

0 commit comments

Comments
 (0)