Skip to content

Sty/pepping #2371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 64 commits into from
Jan 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
c347e82
STY: correcting W503 - line break before binary operator
miykael Jan 5, 2018
862d717
STY: correcting W191 - indentation contains tabs
miykael Jan 5, 2018
f9f98b2
STY: correcting W391 - blank line at end of file
miykael Jan 5, 2018
fba83f1
STY: correcting F402 - import 'op' from line 52 shadowed by loop vari…
miykael Jan 5, 2018
8b66395
STY: correcting of two F811 (not all) - redefinition of unused 'fsl' …
miykael Jan 5, 2018
920ff31
STY: correction of F841 - local variable 'xyz' is assigned to but nev…
miykael Jan 6, 2018
9adf310
STY: correction of F999 - xyz be undefined, or defined from star impo…
miykael Jan 6, 2018
67b2a07
STY: correction of E129 - visually indented line with same indent as …
miykael Jan 6, 2018
ea91c74
STY: correction of E266 - too many leading '#' for block comment
miykael Jan 6, 2018
149322e
STY: correction of E271 - multiple spaces after keyword
miykael Jan 6, 2018
4123f96
STY: correction of E714 - test for object identity should be 'is not'
miykael Jan 6, 2018
2bd5af0
STY: correction of E125 - continuation line with same indent as next …
miykael Jan 6, 2018
52b7f7f
STY: correction of E222 - multiple spaces after operator
miykael Jan 6, 2018
0a754e0
STY: correction of E228 - missing whitespace around modulo operator
miykael Jan 6, 2018
41cf6ae
STY: correction of E713 - test for membership should be 'not in'
miykael Jan 6, 2018
2a73507
STY: correction of E202 - whitespace before ')'
miykael Jan 6, 2018
f74b57f
STY: correction of E201 - whitespace after '{'
miykael Jan 6, 2018
d0bbf3b
STY: correction of E211 - whitespace before '('
miykael Jan 6, 2018
57228bc
STY: correction of E272 - multiple spaces before keyword
miykael Jan 6, 2018
7d673e3
STY: correction of E301 - expected 1 blank line, found 0
miykael Jan 6, 2018
dad9539
STY: correction of E401 - multiple imports on one line
miykael Jan 6, 2018
997c06e
STY: correction of E711 - comparison to None should be 'if cond is No…
miykael Jan 6, 2018
f92c36c
STY: correction of E712 - comparison to False should be 'if cond is F…
miykael Jan 6, 2018
d594e73
STY: correction of E131 - continuation line unaligned for hanging indent
miykael Jan 6, 2018
22d37d3
STY: correction of E262 - inline comment should start with '# '
miykael Jan 6, 2018
f21518e
STY: deletion of pylint info
miykael Jan 6, 2018
bdac9b1
STY: correction of E225 - missing whitespace around operator
miykael Jan 6, 2018
cb71b18
STY: correction of E251 - unexpected spaces around keyword / paramete…
miykael Jan 6, 2018
9ed771f
STY: correction of E221 - multiple spaces before operator
miykael Jan 6, 2018
70681c0
STY: correction of E502 - the backslash is redundant between brackets
miykael Jan 6, 2018
6d3a76b
STY: correction of E701 - multiple statements on one line (colon)
miykael Jan 6, 2018
d540d54
STY: correction of E203 - whitespace before ':' or ','
miykael Jan 6, 2018
a9b0feb
STY: correction of E261 - at least two spaces before inline comment
miykael Jan 6, 2018
ed7db38
STY: correction of E111 - indentation is not a multiple of four
miykael Jan 6, 2018
777985d
STY: correction of most E265 - block comment should start with '# '
miykael Jan 6, 2018
3f5fdd7
STY: correction of E124 - closing bracket does not match visual inden…
miykael Jan 6, 2018
0a46373
STY: correction of E302 - expected 2 blank lines, found 1
miykael Jan 6, 2018
1ba0af5
STY: correction of E127 - continuation line over-indented for visual …
miykael Jan 6, 2018
40de6ab
STY: correction of E128 - continuation line under-indented for visual…
miykael Jan 6, 2018
1555bcc
STY: correction of E231 - missing whitespace after ',' or ':'
miykael Jan 6, 2018
561d2b4
STY: correction of different errors that were missed the first time
miykael Jan 6, 2018
f3accc0
Merge remote-tracking branch 'upstream/master' into pep8_violation_No…
miykael Jan 6, 2018
248e75b
STY: correction of E712 - comparison to False should be 'if cond is F…
miykael Jan 6, 2018
c048918
STY: correction of E501 - __future__ import too long
miykael Jan 6, 2018
3257872
STY: correction of E501 - line too long (82 > 79 characters) - Part 1
miykael Jan 6, 2018
c4f6415
FIX: reseting lambda change - wil be corrected in later PR
miykael Jan 8, 2018
ed1ad30
FIX: revert E501 changes in doc description to please doctest
miykael Jan 8, 2018
730c1a1
STY: correcting previously auto-generated file to confirm to pep8 norm
miykael Jan 9, 2018
e98e51b
Merge branch 'master' into pep8_violation_Nov2017
miykael Jan 9, 2018
b6f9f15
[skip ci] Update STY CHANGES
miykael Jan 9, 2018
501e65f
Merge remote-tracking branch 'upstream/master' into sty/pepping
satra Jan 11, 2018
98c6d11
sty: using yapf to clean pep8 issues
satra Jan 11, 2018
a8389aa
fix: autotests
satra Jan 12, 2018
21bd9c2
fix: specs
satra Jan 12, 2018
53f07ad
sty: add yapf to extras installs
satra Jan 12, 2018
7c35d33
sty: cleanup tools folder
satra Jan 12, 2018
1b1f059
fix: conflicts
satra Jan 12, 2018
7b21b4a
sty: fix styles in updated interfaces
satra Jan 12, 2018
c1900d9
sty: fix examples
satra Jan 12, 2018
1f341bd
fix: composemultitransform doctest
satra Jan 12, 2018
b3272cf
Merge branch 'master' into sty/pepping
effigies Jan 17, 2018
ec7ec8c
resolve conflict
satra Jan 17, 2018
0e27fe3
resolve conflict
satra Jan 17, 2018
2d48ce8
Merge remote-tracking branch 'upstream/master' into sty/pepping
effigies Jan 17, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Upcoming release (0.14.1)
* FIX: Robustly handled outputs of 3dFWHMx across different versions of AFNI (https://github.com/nipy/nipype/pull/2373)
* FIX: Cluster threshold in randomise + change default prefix (https://github.com/nipy/nipype/pull/2369)
* MAINT: Cleaning / simplify ``Node`` (https://github.com/nipy/nipype/pull/#2325)
* STY: Cleanup of PEP8 violations (https://github.com/nipy/nipype/pull/2358)
* STY: Cleanup of trailing spaces and adding of missing newlines at end of files (https://github.com/nipy/nipype/pull/2355)

0.14.0 (November 29, 2017)
==========================
Expand Down
13 changes: 7 additions & 6 deletions build_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

python setup.py build_sphinx
"""
from __future__ import print_function, division, unicode_literals, absolute_import
from __future__ import (print_function, division, unicode_literals,
absolute_import)
from builtins import open, str

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

################################################################################
###############################################################################
# Distutils Command class for installing nipype to a temporary location.


Expand Down Expand Up @@ -63,7 +64,7 @@ def finalize_options(self):
pass


################################################################################
###############################################################################
# Distutils Command class for API generation
class APIDocs(TempInstall):
description = \
Expand Down Expand Up @@ -93,7 +94,7 @@ def run(self):
os.chdir('..')


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


################################################################################
###############################################################################
# Distutils Command class build the docs
# Sphinx import.
try:
Expand Down Expand Up @@ -165,7 +166,7 @@ def finalize_options(self):
self.build_dir = os.path.join(*DOC_BUILD_DIR.split(os.sep)[:-1])
BuildDoc.finalize_options(self)

################################################################################
###############################################################################
# Distutils Command class to clean


Expand Down
20 changes: 13 additions & 7 deletions doc/sphinxext/autosummary_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ def main():
help="Phantom import modules from a file")
p.add_option("-o", "--output-dir", action="store", type="string",
dest="output_dir", default=None,
help=("Write all output files to the given directory (instead "
"of writing them as specified in the autosummary:: "
"directives)"))
help=("Write all output files to the given directory "
"(instead of writing them as specified in the "
"autosummary:: directives)"))
options, args = p.parse_args()

if len(args) == 0:
Expand Down Expand Up @@ -161,9 +161,12 @@ def get_documented_in_lines(lines, module=None, filename=None):

"""
title_underline_re = re.compile("^[-=*_^#]{3,}\s*$")
autodoc_re = re.compile(".. auto(function|method|attribute|class|exception|module)::\s*([A-Za-z0-9_.]+)\s*$")
autodoc_re = re.compile(
".. auto(function|method|attribute|class|exception|module)::"
"\s*([A-Za-z0-9_.]+)\s*$")
autosummary_re = re.compile(r'^\.\.\s+autosummary::\s*')
module_re = re.compile(r'^\.\.\s+(current)?module::\s*([a-zA-Z0-9_.]+)\s*$')
module_re = re.compile(
r'^\.\.\s+(current)?module::\s*([a-zA-Z0-9_.]+)\s*$')
autosummary_item_re = re.compile(r'^\s+([_a-zA-Z][a-zA-Z0-9_.]*)\s*.*?')
toctree_arg_re = re.compile(r'^\s+:toctree:\s*(.*?)\s*$')

Expand All @@ -189,7 +192,8 @@ def get_documented_in_lines(lines, module=None, filename=None):
m = autosummary_item_re.match(line)
if m:
name = m.group(1).strip()
if current_module and not name.startswith(current_module + '.'):
if current_module and not name.startswith(
current_module + '.'):
name = "%s.%s" % (current_module, name)
documented.setdefault(name, []).append(
(filename, current_title, 'autosummary', toctree))
Expand All @@ -210,7 +214,8 @@ def get_documented_in_lines(lines, module=None, filename=None):
current_module = name
documented.update(get_documented_in_docstring(
name, filename=filename))
elif current_module and not name.startswith(current_module + '.'):
elif current_module and not name.startswith(
current_module + '.'):
name = "%s.%s" % (current_module, name)
documented.setdefault(name, []).append(
(filename, current_title, "auto" + m.group(1), None))
Expand All @@ -230,5 +235,6 @@ def get_documented_in_lines(lines, module=None, filename=None):

return documented


if __name__ == "__main__":
main()
16 changes: 8 additions & 8 deletions doc/sphinxext/ipython_console_highlighting.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ class IPythonConsoleLexer(Lexer):

def get_tokens_unprocessed(self, text):
pylexer = PythonLexer(**self.options)
tblexer = PythonTracebackLexer(**self.options)

curcode = ''
insertions = []
Expand All @@ -72,21 +71,22 @@ def get_tokens_unprocessed(self, text):
insertions.append((len(curcode),
[(0, Comment, line)]))
elif input_prompt is not None:
insertions.append((len(curcode),
[(0, Generic.Prompt, input_prompt.group())]))
insertions.append((len(
curcode), [(0, Generic.Prompt, input_prompt.group())]))
curcode += line[input_prompt.end():]
elif continue_prompt is not None:
insertions.append((len(curcode),
[(0, Generic.Prompt, continue_prompt.group())]))
insertions.append((len(
curcode), [(0, Generic.Prompt, continue_prompt.group())]))
curcode += line[continue_prompt.end():]
elif output_prompt is not None:
insertions.append((len(curcode),
[(0, Generic.Output, output_prompt.group())]))
insertions.append((len(
curcode), [(0, Generic.Output, output_prompt.group())]))
curcode += line[output_prompt.end():]
else:
if curcode:
for item in do_insertions(insertions,
pylexer.get_tokens_unprocessed(curcode)):
pylexer.get_tokens_unprocessed(
curcode)):
yield item
curcode = ''
insertions = []
Expand Down
6 changes: 3 additions & 3 deletions doc/sphinxext/numpy_ext/docscrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@ def _parse(self):

for (section, content) in self._read_sections():
if not section.startswith('..'):
section = ' '.join([s.capitalize() for s in section.split(' ')])
section = ' '.join([s.capitalize()
for s in section.split(' ')])
if section in ('Parameters', 'Returns', 'Raises', 'Warns',
'Other Parameters', 'Attributes', 'Methods'):
self[section] = self._parse_param_list(content)
Expand Down Expand Up @@ -443,7 +444,7 @@ def __init__(self, func, role='func', doc=None, config={}):
argspec = inspect.formatargspec(*argspec)
argspec = argspec.replace('*', '\*')
signature = '%s%s' % (func_name, argspec)
except TypeError as e:
except TypeError:
signature = '%s()' % func_name
self['Signature'] = signature

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

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

roles = {'func': 'function',
'meth': 'method'}
Expand Down
2 changes: 1 addition & 1 deletion doc/sphinxext/numpy_ext/numpydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- Convert Parameters etc. sections to field lists.
- Convert See Also section to a See also entry.
- Renumber references.
- Extract the signature from the docstring, if it can't be determined otherwise.
- Extract signature from docstring, if it can't be determined otherwise.

.. [1] https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt

Expand Down
Loading