Skip to content

Commit b60de4c

Browse files
committed
FIX: PEP8 - E714 test for object identity should be 'is not'
1 parent 89d13fa commit b60de4c

File tree

9 files changed

+12
-12
lines changed

9 files changed

+12
-12
lines changed

nipype/algorithms/misc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,7 @@ def normalize_tpms(in_files, in_mask=None, out_files=[]):
12711271
msk = np.ones_like(imgs[0].get_data())
12721272
msk[weights <= 0] = 0
12731273

1274-
if not in_mask is None:
1274+
if in_mask is not None:
12751275
msk = nib.load(in_mask).get_data()
12761276
msk[msk <= 0] = 0
12771277
msk[msk > 0] = 1

nipype/interfaces/ants/registration.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def _transformation_constructor(self):
157157
retval = ['--transformation-model %s' % model]
158158
parameters = []
159159
for elem in (stepLength, timeStep, deltaTime, symmetryType):
160-
if not elem is traits.Undefined:
160+
if elem is not traits.Undefined:
161161
parameters.append('%#.2g' % elem)
162162
if len(parameters) > 0:
163163
if len(parameters) > 1:

nipype/interfaces/dcmstack.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def _get_out_path(self, meta, idx=None):
6363
# If no out_format is specified, use a sane default that will work
6464
# with the provided meta data.
6565
out_fmt = []
66-
if not idx is None:
66+
if idx is not None:
6767
out_fmt.append('%03d' % idx)
6868
if 'SeriesNumber' in meta:
6969
out_fmt.append('%(SeriesNumber)03d')

nipype/interfaces/elastix/utils.py

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

138138
def _get_outfile(self):
139139
val = getattr(self, '_out_file')
140-
if not val is None and not val == '':
140+
if val is not None and val != '':
141141
return val
142142

143143
if isdefined(self.inputs.output_file):

nipype/interfaces/fsl/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1933,7 +1933,7 @@ def _run_interface(self, runtime):
19331933
runtime = super(WarpPoints, self)._run_interface(runtime)
19341934
newpoints = np.fromstring('\n'.join(runtime.stdout.split('\n')[1:]), sep=' ')
19351935

1936-
if not tmpfile is None:
1936+
if tmpfile is not None:
19371937
try:
19381938
os.remove(tmpfile.name)
19391939
except:

nipype/interfaces/io.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,7 @@ def _match_path(self, target_path):
11001100
return
11011101
# Check if we can match the path
11021102
match = self.match_regex.search(target_path)
1103-
if not match is None:
1103+
if match is not None:
11041104
match_dict = match.groupdict()
11051105
if self.result is None:
11061106
self.result = {'out_paths': []}

nipype/pipeline/plugins/dagman.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def _submit_graph(self, pyfiles, dependencies, nodes):
127127
basename=os.path.join(batch_dir, name),
128128
override_specs=override_specs
129129
)
130-
if not wrapper_cmd is None:
130+
if wrapper_cmd is not None:
131131
specs['executable'] = wrapper_cmd
132132
specs['nodescript'] = \
133133
'%s %s %s' % (wrapper_args % specs, # give access to variables

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def package_check(pkg_name, version=None,
172172
dependencies. If dict fill key values ``install_requires`` and
173173
``extras_require`` for non-optional and optional dependencies.
174174
'''
175-
setuptools_mode = not setuptools_args is None
175+
setuptools_mode = setuptools_args is not None
176176
optional_tf = bool(optional)
177177
if version_getter is None:
178178
def version_getter(pkg_name):

tools/gitwash_dumper.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ def make_link_targets(proj_name,
116116
.. _`proj_name` mailing list: url
117117
"""
118118
link_contents = open(known_link_fname, 'rt').readlines()
119-
have_url = not url is None
120-
have_ml_url = not ml_url is None
119+
have_url = url is not None
120+
have_ml_url = ml_url is not None
121121
have_gh_url = None
122122
for line in link_contents:
123123
if not have_url:
@@ -136,12 +136,12 @@ def make_link_targets(proj_name,
136136
raise RuntimeError('Need command line or known project '
137137
'and / or mailing list URLs')
138138
lines = []
139-
if not url is None:
139+
if url is not None:
140140
lines.append('.. _%s: %s\n' % (proj_name, url))
141141
if not have_gh_url:
142142
gh_url = 'http://github.com/%s/%s\n' % (user_name, repo_name)
143143
lines.append('.. _`%s github`: %s\n' % (proj_name, gh_url))
144-
if not ml_url is None:
144+
if ml_url is not None:
145145
lines.append('.. _`%s mailing list`: %s\n' % (proj_name, ml_url))
146146
if len(lines) == 0:
147147
# Nothing to do

0 commit comments

Comments
 (0)