Skip to content

FIX: PEP8 correction for all error E100-E399 #1255

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 36 commits into from
Oct 28, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
9ad9a95
FIX: PEP8 - E101 indentation contains mixed spaces and tabs
miykael Oct 17, 2015
d7f9412
FIX: PEP8 - E111 indentation is not a multiple of four
miykael Oct 17, 2015
16a5d14
FIX: PEP8 - E114 indentation is not a multiple of four (comment)
miykael Oct 17, 2015
aa8d0dc
FIX: PEP8 - E115 expected an indented block (comment)
miykael Oct 17, 2015
f15677b
FIX: PEP8 - E116 unexpected indentation (comment)
miykael Oct 17, 2015
3031188
FIX: PEP8 - E122 continuation line missing indentation or outdented
miykael Oct 17, 2015
a0dde7a
FIX: PEP8 - E124 closing bracket does not match visual indentation
miykael Oct 17, 2015
9f5e1de
FIX: PEP8 - E125 continuation line with same indent as next logical line
miykael Oct 17, 2015
452ca79
FIX: PEP8 - E127 continuation line over-indented for visual indent
miykael Oct 17, 2015
4089ead
FIX: PEP8 - E128 continuation line under-indented for visual indent
miykael Oct 17, 2015
17d8cd5
FIX: PEP8 - E129 visually indented line with same indent as next logi…
miykael Oct 17, 2015
84500db
FIX: PEP8 - E128 continuation line under-indented for visual indent
miykael Oct 17, 2015
0ae9f22
FIX: PEP8 - E131 continuation line unaligned for hanging indent
miykael Oct 17, 2015
4f9f5a5
FIX: PEP8 - E201 whitespace after '(' '[' '{'
miykael Oct 17, 2015
01e7b30
FIX: PEP8 - E202 whitespace before ')' ']' '}'
miykael Oct 17, 2015
fc9ff54
FIX: PEP8 - E203 whitespace before ',' ':'
miykael Oct 17, 2015
f74e738
FIX: PEP8 - E211 whitespace before '('
miykael Oct 17, 2015
ff755a4
FIX: PEP8 - E221 multiple spaces before operator
miykael Oct 17, 2015
827fc72
FIX: PEP8 - E222 multiple spaces after operator
miykael Oct 17, 2015
9007d17
FIX: PEP8 - E225 missing whitespace around operator
miykael Oct 17, 2015
f8a8eb4
FIX: PEP8 - E227 missing whitespace around bitwise or shift operator
miykael Oct 17, 2015
3951685
FIX: PEP8 - E228 missing whitespace around modulo operator
miykael Oct 17, 2015
a663c5d
FIX: PEP8 - E231 missing whitespace after ','
miykael Oct 17, 2015
7f2020c
FIX: PEP8 - E251 unexpected spaces around keyword / parameter equals
miykael Oct 17, 2015
f7e16fd
FIX: PEP8 - E261 at least two spaces before inline comment
miykael Oct 17, 2015
ae91a01
FIX: PEP8 - E262 inline comment should start with '# '
miykael Oct 17, 2015
c3ee8c7
FIX: PEP8 - E265 block comment should start with '# '
miykael Oct 17, 2015
001af98
FIX: PEP8 - E266 too many leading '#' for block comment
miykael Oct 17, 2015
28156a8
FIX: PEP8 - E271 multiple spaces after keyword
miykael Oct 17, 2015
b1d4220
FIX: PEP8 - E272 multiple spaces before keyword
miykael Oct 17, 2015
eb464cd
FIX: PEP8 - E301 expected 1 blank line, found 0
miykael Oct 17, 2015
a79f91d
FIX: PEP8 - E302 expected 2 blank lines, found 1
miykael Oct 17, 2015
c08b0ee
FIX: PEP8 - E303 too many blank lines (2)
miykael Oct 17, 2015
9c5781e
FIX: PEP8 - E122 continuation line missing indentation or outdented
miykael Oct 17, 2015
2374698
FIX: PEP8 adjustment for auto-generated test files
miykael Oct 18, 2015
d6f6f01
FIX: Reverts PEP8 E101 change of nipype/utils/tests/test_cmd.py
miykael Oct 19, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions build_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,20 @@

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


class TempInstall(Command):
temp_install_dir = os.path.join('build', 'install')

def run(self):
""" build and install nipype in a temporary location. """
install = self.distribution.get_command_obj('install')
install.install_scripts = self.temp_install_dir
install.install_base = self.temp_install_dir
install.install_base = self.temp_install_dir
install.install_platlib = self.temp_install_dir
install.install_purelib = self.temp_install_dir
install.install_data = self.temp_install_dir
install.install_lib = self.temp_install_dir
install.install_data = self.temp_install_dir
install.install_lib = self.temp_install_dir
install.install_headers = self.temp_install_dir
install.run()

Expand All @@ -64,13 +66,12 @@ def finalize_options(self):
# Distutils Command class for API generation
class APIDocs(TempInstall):
description = \
"""generate API docs """
"""generate API docs """

user_options = [
('None', None, 'this command has no options'),
]


def run(self):
# First build the project and install it to a temporary location.
TempInstall.run(self)
Expand Down Expand Up @@ -141,22 +142,21 @@ def zip_docs(self):
# require zlib.
try:
zf = zipfile.ZipFile(target_file, 'w',
compression=zipfile.ZIP_DEFLATED)
compression=zipfile.ZIP_DEFLATED)
except RuntimeError:
warnings.warn('zlib not installed, storing the docs '
'without compression')
'without compression')
zf = zipfile.ZipFile(target_file, 'w',
compression=zipfile.ZIP_STORED)
compression=zipfile.ZIP_STORED)

for root, dirs, files in os.walk(DOC_BUILD_DIR):
relative = relative_path(root)
if not relative.startswith('.doctrees'):
for f in files:
zf.write(os.path.join(root, f),
os.path.join(relative, 'html_docs', f))
os.path.join(relative, 'html_docs', f))
zf.close()


def finalize_options(self):
""" Override the default for the documentation build
directory.
Expand All @@ -166,6 +166,8 @@ def finalize_options(self):

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


class Clean(clean):

def run(self):
Expand Down
8 changes: 4 additions & 4 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import sys, os

nipypepath = os.path.abspath('..')
sys.path.insert(1,nipypepath)
sys.path.insert(1, nipypepath)

import nipype

Expand Down Expand Up @@ -168,9 +168,9 @@
#html_use_smartypants = True

# Custom sidebar templates, maps document names to template names.
html_sidebars = {'**': ['gse.html','localtoc.html', 'sidebar_versions.html', 'indexsidebar.html'],
'searchresults' : ['sidebar_versions.html', 'indexsidebar.html'],
'version' : []}
html_sidebars = {'**': ['gse.html', 'localtoc.html', 'sidebar_versions.html', 'indexsidebar.html'],
'searchresults': ['sidebar_versions.html', 'indexsidebar.html'],
'version': []}

# Additional templates that should be rendered to pages, maps page names to
# template names.
Expand Down
8 changes: 7 additions & 1 deletion doc/sphinxext/autosummary_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
except ImportError:
import_phantom_module = lambda x: x


def main():
p = optparse.OptionParser(__doc__.strip())
p.add_option("-p", "--phantom", action="store", type="string",
Expand Down Expand Up @@ -95,16 +96,19 @@ def main():
finally:
f.close()


def format_modulemember(name, directive):
parts = name.split('.')
mod, name = '.'.join(parts[:-1]), parts[-1]
return ".. currentmodule:: %s\n\n.. %s:: %s\n" % (mod, directive, name)


def format_classmember(name, directive):
parts = name.split('.')
mod, name = '.'.join(parts[:-2]), '.'.join(parts[-2:])
return ".. currentmodule:: %s\n\n.. %s:: %s\n" % (mod, directive, name)


def get_documented(filenames):
"""
Find out what items are documented in source/*.rst
Expand All @@ -119,6 +123,7 @@ def get_documented(filenames):
f.close()
return documented


def get_documented_in_docstring(name, module=None, filename=None):
"""
Find out what items are documented in the given object's docstring.
Expand All @@ -135,6 +140,7 @@ def get_documented_in_docstring(name, module=None, filename=None):
print("Failed to import '%s': %s" % (name, e))
return {}


def get_documented_in_lines(lines, module=None, filename=None):
"""
Find out what items are documented in the given lines
Expand Down Expand Up @@ -173,7 +179,7 @@ def get_documented_in_lines(lines, module=None, filename=None):
continue

if line.strip().startswith(':'):
continue # skip options
continue # skip options

m = autosummary_item_re.match(line)
if m:
Expand Down
9 changes: 5 additions & 4 deletions doc/sphinxext/ipython_console_highlighting.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""reST directive for syntax-highlighting ipython interactive sessions.
"""

#-----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# Needed modules

# Standard library
Expand All @@ -18,13 +18,14 @@
from sphinx import highlighting


#-----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# Global constants
line_re = re.compile('.*?\n')

#-----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# Code begins - classes and functions


class IPythonConsoleLexer(Lexer):
"""
For IPython console output or doctests, such as:
Expand Down Expand Up @@ -95,6 +96,6 @@ def get_tokens_unprocessed(self, text):
pylexer.get_tokens_unprocessed(curcode)):
yield item

#-----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# Register the extension as a valid pygments lexer
highlighting.lexers['ipython'] = IPythonConsoleLexer()
Loading