Skip to content

Commit 045b28e

Browse files
authored
Merge pull request #2371 from satra/sty/pepping
Sty/pepping
2 parents 7efc965 + 2d48ce8 commit 045b28e

File tree

1,220 files changed

+81154
-63527
lines changed

Some content is hidden

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

1,220 files changed

+81154
-63527
lines changed

CHANGES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Upcoming release (0.14.1)
44
* FIX: Robustly handled outputs of 3dFWHMx across different versions of AFNI (https://github.com/nipy/nipype/pull/2373)
55
* FIX: Cluster threshold in randomise + change default prefix (https://github.com/nipy/nipype/pull/2369)
66
* MAINT: Cleaning / simplify ``Node`` (https://github.com/nipy/nipype/pull/#2325)
7+
* STY: Cleanup of PEP8 violations (https://github.com/nipy/nipype/pull/2358)
8+
* STY: Cleanup of trailing spaces and adding of missing newlines at end of files (https://github.com/nipy/nipype/pull/2355)
79

810
0.14.0 (November 29, 2017)
911
==========================

build_docs.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
99
python setup.py build_sphinx
1010
"""
11-
from __future__ import print_function, division, unicode_literals, absolute_import
11+
from __future__ import (print_function, division, unicode_literals,
12+
absolute_import)
1213
from builtins import open, str
1314

1415
# Standard library imports
@@ -28,7 +29,7 @@
2829
DOC_BUILD_DIR = os.path.join('doc', '_build', 'html')
2930
DOC_DOCTREES_DIR = os.path.join('doc', '_build', 'doctrees')
3031

31-
################################################################################
32+
###############################################################################
3233
# Distutils Command class for installing nipype to a temporary location.
3334

3435

@@ -63,7 +64,7 @@ def finalize_options(self):
6364
pass
6465

6566

66-
################################################################################
67+
###############################################################################
6768
# Distutils Command class for API generation
6869
class APIDocs(TempInstall):
6970
description = \
@@ -93,7 +94,7 @@ def run(self):
9394
os.chdir('..')
9495

9596

96-
################################################################################
97+
###############################################################################
9798
# Code to copy the sphinx-generated html docs in the distribution.
9899
def relative_path(filename):
99100
""" Return the relative path to the file, assuming the file is
@@ -103,7 +104,7 @@ def relative_path(filename):
103104
return os.path.abspath(filename)[length:]
104105

105106

106-
################################################################################
107+
###############################################################################
107108
# Distutils Command class build the docs
108109
# Sphinx import.
109110
try:
@@ -165,7 +166,7 @@ def finalize_options(self):
165166
self.build_dir = os.path.join(*DOC_BUILD_DIR.split(os.sep)[:-1])
166167
BuildDoc.finalize_options(self)
167168

168-
################################################################################
169+
###############################################################################
169170
# Distutils Command class to clean
170171

171172

doc/sphinxext/autosummary_generate.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ def main():
3939
help="Phantom import modules from a file")
4040
p.add_option("-o", "--output-dir", action="store", type="string",
4141
dest="output_dir", default=None,
42-
help=("Write all output files to the given directory (instead "
43-
"of writing them as specified in the autosummary:: "
44-
"directives)"))
42+
help=("Write all output files to the given directory "
43+
"(instead of writing them as specified in the "
44+
"autosummary:: directives)"))
4545
options, args = p.parse_args()
4646

4747
if len(args) == 0:
@@ -161,9 +161,12 @@ def get_documented_in_lines(lines, module=None, filename=None):
161161
162162
"""
163163
title_underline_re = re.compile("^[-=*_^#]{3,}\s*$")
164-
autodoc_re = re.compile(".. auto(function|method|attribute|class|exception|module)::\s*([A-Za-z0-9_.]+)\s*$")
164+
autodoc_re = re.compile(
165+
".. auto(function|method|attribute|class|exception|module)::"
166+
"\s*([A-Za-z0-9_.]+)\s*$")
165167
autosummary_re = re.compile(r'^\.\.\s+autosummary::\s*')
166-
module_re = re.compile(r'^\.\.\s+(current)?module::\s*([a-zA-Z0-9_.]+)\s*$')
168+
module_re = re.compile(
169+
r'^\.\.\s+(current)?module::\s*([a-zA-Z0-9_.]+)\s*$')
167170
autosummary_item_re = re.compile(r'^\s+([_a-zA-Z][a-zA-Z0-9_.]*)\s*.*?')
168171
toctree_arg_re = re.compile(r'^\s+:toctree:\s*(.*?)\s*$')
169172

@@ -189,7 +192,8 @@ def get_documented_in_lines(lines, module=None, filename=None):
189192
m = autosummary_item_re.match(line)
190193
if m:
191194
name = m.group(1).strip()
192-
if current_module and not name.startswith(current_module + '.'):
195+
if current_module and not name.startswith(
196+
current_module + '.'):
193197
name = "%s.%s" % (current_module, name)
194198
documented.setdefault(name, []).append(
195199
(filename, current_title, 'autosummary', toctree))
@@ -210,7 +214,8 @@ def get_documented_in_lines(lines, module=None, filename=None):
210214
current_module = name
211215
documented.update(get_documented_in_docstring(
212216
name, filename=filename))
213-
elif current_module and not name.startswith(current_module + '.'):
217+
elif current_module and not name.startswith(
218+
current_module + '.'):
214219
name = "%s.%s" % (current_module, name)
215220
documented.setdefault(name, []).append(
216221
(filename, current_title, "auto" + m.group(1), None))
@@ -230,5 +235,6 @@ def get_documented_in_lines(lines, module=None, filename=None):
230235

231236
return documented
232237

238+
233239
if __name__ == "__main__":
234240
main()

doc/sphinxext/ipython_console_highlighting.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ class IPythonConsoleLexer(Lexer):
5959

6060
def get_tokens_unprocessed(self, text):
6161
pylexer = PythonLexer(**self.options)
62-
tblexer = PythonTracebackLexer(**self.options)
6362

6463
curcode = ''
6564
insertions = []
@@ -72,21 +71,22 @@ def get_tokens_unprocessed(self, text):
7271
insertions.append((len(curcode),
7372
[(0, Comment, line)]))
7473
elif input_prompt is not None:
75-
insertions.append((len(curcode),
76-
[(0, Generic.Prompt, input_prompt.group())]))
74+
insertions.append((len(
75+
curcode), [(0, Generic.Prompt, input_prompt.group())]))
7776
curcode += line[input_prompt.end():]
7877
elif continue_prompt is not None:
79-
insertions.append((len(curcode),
80-
[(0, Generic.Prompt, continue_prompt.group())]))
78+
insertions.append((len(
79+
curcode), [(0, Generic.Prompt, continue_prompt.group())]))
8180
curcode += line[continue_prompt.end():]
8281
elif output_prompt is not None:
83-
insertions.append((len(curcode),
84-
[(0, Generic.Output, output_prompt.group())]))
82+
insertions.append((len(
83+
curcode), [(0, Generic.Output, output_prompt.group())]))
8584
curcode += line[output_prompt.end():]
8685
else:
8786
if curcode:
8887
for item in do_insertions(insertions,
89-
pylexer.get_tokens_unprocessed(curcode)):
88+
pylexer.get_tokens_unprocessed(
89+
curcode)):
9090
yield item
9191
curcode = ''
9292
insertions = []

doc/sphinxext/numpy_ext/docscrape.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@ def _parse(self):
295295

296296
for (section, content) in self._read_sections():
297297
if not section.startswith('..'):
298-
section = ' '.join([s.capitalize() for s in section.split(' ')])
298+
section = ' '.join([s.capitalize()
299+
for s in section.split(' ')])
299300
if section in ('Parameters', 'Returns', 'Raises', 'Warns',
300301
'Other Parameters', 'Attributes', 'Methods'):
301302
self[section] = self._parse_param_list(content)
@@ -443,7 +444,7 @@ def __init__(self, func, role='func', doc=None, config={}):
443444
argspec = inspect.formatargspec(*argspec)
444445
argspec = argspec.replace('*', '\*')
445446
signature = '%s%s' % (func_name, argspec)
446-
except TypeError as e:
447+
except TypeError:
447448
signature = '%s()' % func_name
448449
self['Signature'] = signature
449450

@@ -459,7 +460,6 @@ def __str__(self):
459460
out = ''
460461

461462
func, func_name = self.get_func()
462-
signature = self['Signature'].replace('*', '\*')
463463

464464
roles = {'func': 'function',
465465
'meth': 'method'}

doc/sphinxext/numpy_ext/numpydoc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
- Convert Parameters etc. sections to field lists.
1212
- Convert See Also section to a See also entry.
1313
- Renumber references.
14-
- Extract the signature from the docstring, if it can't be determined otherwise.
14+
- Extract signature from docstring, if it can't be determined otherwise.
1515
1616
.. [1] https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt
1717

0 commit comments

Comments
 (0)