Skip to content

Commit f4d89d6

Browse files
committed
FIX: PEP8 - missing whitespace around operator (E225) or arithmetic operator (E226) - 2nd clean up
1 parent b60de4c commit f4d89d6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+252
-252
lines changed

doc/sphinxext/autosummary_generate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def main():
8181
f = open(fn, 'w')
8282

8383
try:
84-
f.write('%s\n%s\n\n' % (name, '='*len(name)))
84+
f.write('%s\n%s\n\n' % (name, '=' * len(name)))
8585

8686
if inspect.isclass(obj):
8787
if issubclass(obj, Exception):
@@ -210,7 +210,7 @@ def get_documented_in_lines(lines, module=None, filename=None):
210210
current_module = name
211211
documented.update(get_documented_in_docstring(
212212
name, filename=filename))
213-
elif current_module and not name.startswith(current_module+'.'):
213+
elif current_module and not name.startswith(current_module + '.'):
214214
name = "%s.%s" % (current_module, name)
215215
documented.setdefault(name, []).append(
216216
(filename, current_title, "auto" + m.group(1), None))

doc/sphinxext/numpy_ext/docscrape.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def read_to_condition(self, condition_func):
6767
return self[start:self._l]
6868
self._l += 1
6969
if self.eof():
70-
return self[start:self._l+1]
70+
return self[start:self._l + 1]
7171
return []
7272

7373
def read_to_next_empty_line(self):
@@ -139,7 +139,7 @@ def _is_at_section(self):
139139
return True
140140

141141
l2 = self._doc.peek(1).strip() # ---------- or ==========
142-
return l2.startswith('-'*len(l1)) or l2.startswith('='*len(l1))
142+
return l2.startswith('-' * len(l1)) or l2.startswith('=' * len(l1))
143143

144144
def _strip(self, doc):
145145
i = 0
@@ -152,7 +152,7 @@ def _strip(self, doc):
152152
if line.strip():
153153
break
154154

155-
return doc[i:len(doc)-j]
155+
return doc[i:len(doc) - j]
156156

157157
def _read_to_next_section(self):
158158
section = self._doc.read_to_next_empty_line()
@@ -309,12 +309,12 @@ def _parse(self):
309309
# string conversion routines
310310

311311
def _str_header(self, name, symbol='-'):
312-
return [name, len(name)*symbol]
312+
return [name, len(name) * symbol]
313313

314314
def _str_indent(self, doc, indent=4):
315315
out = []
316316
for line in doc:
317-
out += [' '*indent + line]
317+
out += [' ' * indent + line]
318318
return out
319319

320320
def _str_signature(self):
@@ -408,7 +408,7 @@ def __str__(self, func_role=''):
408408

409409

410410
def indent(str, indent=4):
411-
indent_str = ' '*indent
411+
indent_str = ' ' * indent
412412
if str is None:
413413
return indent_str
414414
lines = str.split('\n')
@@ -421,7 +421,7 @@ def dedent_lines(lines):
421421

422422

423423
def header(text, style='-'):
424-
return text + '\n' + style*len(text) + '\n'
424+
return text + '\n' + style * len(text) + '\n'
425425

426426

427427
class FunctionDoc(NumpyDocString):

doc/sphinxext/numpy_ext/docscrape_sphinx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def _str_field_list(self, name):
2323
def _str_indent(self, doc, indent=4):
2424
out = []
2525
for line in doc:
26-
out += [' '*indent + line]
26+
out += [' ' * indent + line]
2727
return out
2828

2929
def _str_signature(self):
@@ -90,7 +90,7 @@ def _str_member_list(self, name):
9090
if others:
9191
maxlen_0 = max([len(x[0]) for x in others])
9292
maxlen_1 = max([len(x[1]) for x in others])
93-
hdr = "="*maxlen_0 + " " + "="*maxlen_1 + " " + "="*10
93+
hdr = "=" * maxlen_0 + " " + "=" * maxlen_1 + " " + "=" * 10
9494
fmt = '%%%ds %%%ds ' % (maxlen_0, maxlen_1)
9595
n_indent = maxlen_0 + maxlen_1 + 4
9696
out += [hdr]

doc/sphinxext/numpy_ext/numpydoc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def mangle_docstrings(app, what, name, obj, options, lines,
4141
if what == 'module':
4242
# Strip top title
4343
title_re = re.compile(ur'^\s*[#*=]{4,}\n[a-z0-9 -]+\n[#*=]{4,}\s*',
44-
re.I |re.S)
44+
re.I | re.S)
4545
lines[:] = title_re.sub(u'', u"\n".join(lines)).split(u"\n")
4646
else:
4747
doc = get_doc_object(obj, what, u"\n".join(lines), config=cfg)

examples/fmri_ants_openfmri.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def create_reg_workflow(name='registration'):
217217
reg.inputs.convergence_window_size = [20] * 2 + [5]
218218
reg.inputs.smoothing_sigmas = [[4, 2, 1]] * 2 + [[1, 0.5, 0]]
219219
reg.inputs.sigma_units = ['vox'] * 3
220-
reg.inputs.shrink_factors = [[3, 2, 1]]*2 + [[4, 2, 1]]
220+
reg.inputs.shrink_factors = [[3, 2, 1]] * 2 + [[4, 2, 1]]
221221
reg.inputs.use_estimate_learning_rate_once = [True] * 3
222222
reg.inputs.use_histogram_matching = [False] * 2 + [True]
223223
reg.inputs.winsorize_lower_quantile = 0.005
@@ -428,7 +428,7 @@ def create_fs_reg_workflow(name='registration'):
428428
reg.inputs.convergence_window_size = [20] * 2 + [5]
429429
reg.inputs.smoothing_sigmas = [[4, 2, 1]] * 2 + [[1, 0.5, 0]]
430430
reg.inputs.sigma_units = ['vox'] * 3
431-
reg.inputs.shrink_factors = [[3, 2, 1]]*2 + [[4, 2, 1]]
431+
reg.inputs.shrink_factors = [[3, 2, 1]] * 2 + [[4, 2, 1]]
432432
reg.inputs.use_estimate_learning_rate_once = [True] * 3
433433
reg.inputs.use_histogram_matching = [False] * 2 + [True]
434434
reg.inputs.winsorize_lower_quantile = 0.005

examples/fmri_freesurfer_smooth.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@
450450
def subjectinfo(subject_id):
451451
from nipype.interfaces.base import Bunch
452452
from copy import deepcopy
453-
print("Subject ID: %s\n" %str(subject_id))
453+
print("Subject ID: %s\n" % str(subject_id))
454454
output = []
455455
names = ['Task-Odd', 'Task-Even']
456456
for r in range(4):
@@ -539,7 +539,7 @@ def subjectinfo(subject_id):
539539

540540

541541
def getsubs(subject_id):
542-
subs = [('_subject_id_%s/' %subject_id, '')]
542+
subs = [('_subject_id_%s/' % subject_id, '')]
543543
return subs
544544

545545
# store relevant outputs from various stages of the 1st level analysis
@@ -579,7 +579,7 @@ def getsubs(subject_id):
579579
l2inputnode = pe.Node(interface=util.IdentityInterface(fields=['contrasts',
580580
'hemi']),
581581
name='inputnode')
582-
l2inputnode.iterables = [('contrasts', list(range(1, len(contrasts)+1))),
582+
l2inputnode.iterables = [('contrasts', list(range(1, len(contrasts) + 1))),
583583
('hemi', ['lh', 'rh'])]
584584

585585
"""
@@ -610,7 +610,7 @@ def ordersubjects(files, subj_list):
610610
outlist = []
611611
for s in subj_list:
612612
for f in files:
613-
if '/%s/' %s in f:
613+
if '/%s/' % s in f:
614614
outlist.append(f)
615615
continue
616616
print(outlist)

examples/fmri_fsl.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def getmiddlevolume(func):
191191

192192

193193
def getthreshop(thresh):
194-
return '-thr %.10f -Tmin -bin' %(0.1*thresh[0][1])
194+
return '-thr %.10f -Tmin -bin' % (0.1 * thresh[0][1])
195195
preproc.connect(getthresh, ('out_stat', getthreshop), threshold, 'op_string')
196196

197197
"""
@@ -259,11 +259,11 @@ def getthreshop(thresh):
259259

260260

261261
def getbtthresh(medianvals):
262-
return [0.75*val for val in medianvals]
262+
return [0.75 * val for val in medianvals]
263263

264264

265265
def getusans(x):
266-
return [[tuple([val[0], 0.75*val[1]])] for val in x]
266+
return [[tuple([val[0], 0.75 * val[1]])] for val in x]
267267

268268
preproc.connect(maskfunc2, 'out_file', smooth, 'in_file')
269269
preproc.connect(medianval, ('out_stat', getbtthresh), smooth, 'brightness_threshold')

examples/fmri_fsl_feeds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
modelspec.inputs.time_repetition = TR
8080
modelspec.inputs.high_pass_filter_cutoff = 100
8181
modelspec.inputs.subject_info = [Bunch(conditions=['Visual', 'Auditory'],
82-
onsets=[list(range(0, int(180*TR), 60)), list(range(0, int(180*TR), 90))],
82+
onsets=[list(range(0, int(180 * TR), 60)), list(range(0, int(180 * TR), 90))],
8383
durations=[[30], [45]],
8484
amplitudes=None,
8585
tmod=None,

examples/fmri_fsl_reuse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def num_copes(files):
202202
def subjectinfo(subject_id):
203203
from nipype.interfaces.base import Bunch
204204
from copy import deepcopy
205-
print("Subject ID: %s\n" %str(subject_id))
205+
print("Subject ID: %s\n" % str(subject_id))
206206
output = []
207207
names = ['Task-Odd', 'Task-Even']
208208
for r in range(4):

examples/fmri_nipy_glm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
def subjectinfo(subject_id):
160160
from nipype.interfaces.base import Bunch
161161
from copy import deepcopy
162-
print("Subject ID: %s\n" %str(subject_id))
162+
print("Subject ID: %s\n" % str(subject_id))
163163
output = []
164164
names = ['Task-Odd', 'Task-Even']
165165
for r in range(4):

0 commit comments

Comments
 (0)