Skip to content

Commit

Permalink
PEP8: Fix E251 unexpected spaces around keyword / parameter equals
Browse files Browse the repository at this point in the history
  • Loading branch information
timleslie committed Apr 12, 2013
1 parent f2a0a90 commit c986397
Show file tree
Hide file tree
Showing 22 changed files with 97 additions and 97 deletions.
2 changes: 1 addition & 1 deletion _dumbdbm_patched.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,6 @@ def close(self):
self._datfile = self._dirfile = self._bakfile = None


def open(file, flag = None, mode = None):
def open(file, flag=None, mode=None):
# flag, mode arguments are currently ignored
return _Database(file)
2 changes: 1 addition & 1 deletion base_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def build_information(self):
return self._build_information
def type_spec(self,name,value):
pass
def declaration_code(self,templatize = 0):
def declaration_code(self,templatize=0):
return ""
def local_dict_code(self):
return ""
Expand Down
2 changes: 1 addition & 1 deletion blitz_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def template_vars(self,inline=0):
res['dims'] = self.dims
return res

def declaration_code(self,templatize = 0,inline=0):
def declaration_code(self,templatize=0,inline=0):
code = '%(py_var)s = %(var_lookup)s;\n' \
'%(c_type)s %(array_name)s = %(var_convert)s;\n' \
'conversion_numpy_check_type(%(array_name)s,%(num_typecode)s,"%(name)s");\n' \
Expand Down
4 changes: 2 additions & 2 deletions blitz_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def blitz(expr,local_dict=None, global_dict=None,check_size=1,verbose=0,**kw):
func = inline_tools.compile_function(expr_code,arg_names,local_dict,
global_dict,module_dir,
compiler='gcc',auto_downcast=1,
verbose = verbose,
type_converters = converters.blitz,
verbose=verbose,
type_converters=converters.blitz,
**kw)
function_catalog.add_function(expr,func,module_dir)
try:
Expand Down
6 changes: 3 additions & 3 deletions build_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ def create_extension(module_path, **kw):
ext = Extension(module_name, **kw)
return ext

def build_extension(module_path,compiler_name = '',build_dir = None,
temp_dir = None, verbose = 0, **kw):
def build_extension(module_path,compiler_name='',build_dir=None,
temp_dir=None, verbose=0, **kw):
""" Build the file given by module_path into a Python extension module.
build_extensions uses distutils to build Python extension modules.
Expand Down Expand Up @@ -270,7 +270,7 @@ def build_extension(module_path,compiler_name = '',build_dir = None,
import copy
environ = copy.deepcopy(os.environ)
try:
setup(name = module_name, ext_modules = [ext],verbose=verb)
setup(name=module_name, ext_modules=[ext],verbose=verb)
finally:
# restore state
os.environ = environ
Expand Down
4 changes: 2 additions & 2 deletions c_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def py_to_c_code(self):
def c_to_py_code(self):
return simple_c_to_py_template % self.template_vars()

def declaration_code(self,templatize = 0,inline=0):
def declaration_code(self,templatize=0,inline=0):
code = '%(py_var)s = %(var_lookup)s;\n' \
'%(c_type)s %(name)s = %(var_convert)s;\n' % \
self.template_vars(inline=inline)
Expand Down Expand Up @@ -241,7 +241,7 @@ def init_info(self):
self.matching_types = [types.UnicodeType]
#self.headers.append('<string>')

def declaration_code(self,templatize = 0,inline=0):
def declaration_code(self,templatize=0,inline=0):
# since wstring doesn't seem to work everywhere, we need to provide
# the length variable Nxxx for the unicode string xxx.
code = '%(py_var)s = %(var_lookup)s;\n' \
Expand Down
6 changes: 3 additions & 3 deletions examples/binary_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def c_int_search(seq,t,chk=1):
}
"""
#return inline_tools.inline(code,['seq','t'],compiler='msvc')
return inline_tools.inline(code,['seq','t'],verbose = 2)
return inline_tools.inline(code,['seq','t'],verbose=2)

def c_int_search_scxx(seq,t,chk=1):
# do partial type checking in Python.
Expand Down Expand Up @@ -91,7 +91,7 @@ def c_int_search_scxx(seq,t,chk=1):
}
"""
#return inline_tools.inline(code,['seq','t'],compiler='msvc')
return inline_tools.inline(code,['seq','t'],verbose = 2)
return inline_tools.inline(code,['seq','t'],verbose=2)

try:
from numpy import *
Expand Down Expand Up @@ -122,7 +122,7 @@ def c_array_int_search(seq,t):
}
"""
#return inline_tools.inline(code,['seq','t'],compiler='msvc')
return inline_tools.inline(code,['seq','t'],verbose = 2,
return inline_tools.inline(code,['seq','t'],verbose=2,
extra_compile_args=['-O2','-G6'])
except:
pass
Expand Down
10 changes: 5 additions & 5 deletions examples/cast_copy_transpose.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ def _cast_copy_transpose(type,a_2d):
new_array(i,j) = a_2d(j,i);
"""
inline_tools.inline(code,['new_array','a_2d'],
type_converters = cblitz,
type_converters=cblitz,
compiler='gcc',
verbose = 1)
verbose=1)
return new_array

def _cast_copy_transpose2(type,a_2d):
Expand Down Expand Up @@ -71,10 +71,10 @@ def _inplace_transpose(a_2d):
}
""" % numeric_type
inline_tools.inline(code,['a_2d'],
type_converters = cblitz,
type_converters=cblitz,
compiler='gcc',
extra_compile_args = ['-funroll-all-loops'],
verbose =2 )
extra_compile_args=['-funroll-all-loops'],
verbose=2 )
return a_2d
#assert(len(shape(a_2d)) == 2)
#type = a_2d.typecode()
Expand Down
12 changes: 6 additions & 6 deletions examples/vq.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ def vq(obs,code_book):
return_val = results;
""" % locals()
code, distortion = inline_tools.inline(code,['obs','code_book'],
type_converters = blitz_type_converters,
compiler = 'gcc',
verbose = 1)
type_converters=blitz_type_converters,
compiler='gcc',
verbose=1)
return code, distortion

def vq2(obs,code_book):
Expand Down Expand Up @@ -124,9 +124,9 @@ def vq2(obs,code_book):
return_val = results;
""" % locals()
code, distortion = inline_tools.inline(code,['obs','code_book'],
type_converters = blitz_type_converters,
compiler = 'gcc',
verbose = 1)
type_converters=blitz_type_converters,
compiler='gcc',
verbose=1)
return code, distortion


Expand Down
4 changes: 2 additions & 2 deletions examples/wx_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from wxPython.wx import *

class MyCanvas(wxScrolledWindow):
def __init__(self, parent, id = -1, size = wxDefaultSize):
def __init__(self, parent, id=-1, size=wxDefaultSize):
wxScrolledWindow.__init__(self, parent, id, wxPoint(0, 0), size, wxSUNKEN_BORDER)

self.lines = []
Expand Down Expand Up @@ -191,7 +191,7 @@ def OnLeftButtonEvent(self, event):
# This example isn't currently used.

class py_canvas(wx.wxWindow):
def __init__(self, parent, id = -1, pos=wx.wxPyDefaultPosition,
def __init__(self, parent, id=-1, pos=wx.wxPyDefaultPosition,
size=wx.wxPyDefaultSize, **attr):
wx.wxWindow.__init__(self, parent, id, pos,size)
#wx.EVT_PAINT(self,self.on_paint)
Expand Down
2 changes: 1 addition & 1 deletion examples/wx_speed.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def NewDrawLines(dc,line):
import time

class Canvas(wxWindow):
def __init__(self, parent, id = -1, size = wxDefaultSize):
def __init__(self, parent, id=-1, size=wxDefaultSize):
wxWindow.__init__(self, parent, id, wxPoint(0, 0), size,
wxSUNKEN_BORDER | wxWANTS_CHARS)
self.calc_points()
Expand Down
14 changes: 7 additions & 7 deletions ext_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def setup_extension(self,location='.',**kw):
kw,file = self.build_kw_and_file(location,kw)
return build_tools.create_extension(file, **kw)

def compile(self,location='.',compiler=None, verbose = 0, **kw):
def compile(self,location='.',compiler=None, verbose=0, **kw):

if compiler is not None:
self.compiler = compiler
Expand All @@ -364,9 +364,9 @@ def compile(self,location='.',compiler=None, verbose = 0, **kw):
# for speed, build in the machines temp directory
temp = catalog.intermediate_dir()

success = build_tools.build_extension(file, temp_dir = temp,
compiler_name = compiler,
verbose = verbose, **kw)
success = build_tools.build_extension(file, temp_dir=temp,
compiler_name=compiler,
verbose=verbose, **kw)
if not success:
raise SystemError('Compilation failed')

Expand All @@ -391,9 +391,9 @@ def generate_module(module_string, module_file):
f.close()
return module_file

def assign_variable_types(variables,local_dict = {}, global_dict = {},
auto_downcast = 1,
type_converters = converters.default):
def assign_variable_types(variables,local_dict={}, global_dict={},
auto_downcast=1,
type_converters=converters.default):
incoming_vars = {}
incoming_vars.update(global_dict)
incoming_vars.update(local_dict)
Expand Down
44 changes: 22 additions & 22 deletions inline_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ def __init__(self,name,compiler=''):
self._build_information.append(common_info.inline_info())

function_cache = {}
def inline(code,arg_names=[],local_dict = None, global_dict = None,
force = 0,
def inline(code,arg_names=[],local_dict=None, global_dict=None,
force=0,
compiler='',
verbose = 0,
support_code = None,
headers = [],
verbose=0,
support_code=None,
headers=[],
customize=None,
type_converters = None,
type_converters=None,
auto_downcast=1,
newarr_converter=0,
**kw):
Expand Down Expand Up @@ -310,11 +310,11 @@ def inline(code,arg_names=[],local_dict = None, global_dict = None,
global_dict,module_dir,
compiler=compiler,
verbose=verbose,
support_code = support_code,
headers = headers,
support_code=support_code,
headers=headers,
customize=customize,
type_converters = type_converters,
auto_downcast = auto_downcast,
type_converters=type_converters,
auto_downcast=auto_downcast,
**kw)

function_catalog.add_function(code,func,module_dir)
Expand Down Expand Up @@ -349,11 +349,11 @@ def inline(code,arg_names=[],local_dict = None, global_dict = None,
global_dict,module_dir,
compiler=compiler,
verbose=verbose,
support_code = support_code,
headers = headers,
support_code=support_code,
headers=headers,
customize=customize,
type_converters = type_converters,
auto_downcast = auto_downcast,
type_converters=type_converters,
auto_downcast=auto_downcast,
**kw)

function_catalog.add_function(code,func,module_dir)
Expand Down Expand Up @@ -421,7 +421,7 @@ def attempt_function_call(code,local_dict,global_dict):
raise ValueError('function with correct signature not found')

def inline_function_code(code,arg_names,local_dict=None,
global_dict=None,auto_downcast = 1,
global_dict=None,auto_downcast=1,
type_converters=None,compiler=''):
call_frame = sys._getframe().f_back
if local_dict is None:
Expand All @@ -430,7 +430,7 @@ def inline_function_code(code,arg_names,local_dict=None,
global_dict = call_frame.f_globals
ext_func = inline_ext_function('compiled_func',code,arg_names,
local_dict,global_dict,auto_downcast,
type_converters = type_converters)
type_converters=type_converters)
from . import build_tools
compiler = build_tools.choose_compiler(compiler)
ext_func.set_compiler(compiler)
Expand All @@ -439,11 +439,11 @@ def inline_function_code(code,arg_names,local_dict=None,
def compile_function(code,arg_names,local_dict,global_dict,
module_dir,
compiler='',
verbose = 1,
support_code = None,
headers = [],
customize = None,
type_converters = None,
verbose=1,
support_code=None,
headers=[],
customize=None,
type_converters=None,
auto_downcast=1,
**kw):
# figure out where to store and what to name the extension module
Expand All @@ -458,7 +458,7 @@ def compile_function(code,arg_names,local_dict,global_dict,
# type factories setting
ext_func = inline_ext_function('compiled_func',code,arg_names,
local_dict,global_dict,auto_downcast,
type_converters = type_converters)
type_converters=type_converters)
mod.add_function(ext_func)

# if customize (a custom_info object), then set the module customization.
Expand Down
2 changes: 1 addition & 1 deletion platform_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def configure_sys_argv(compiler_name):
def restore_sys_argv():
sys.argv = old_argv

def gcc_exists(name = 'gcc'):
def gcc_exists(name='gcc'):
""" Test to make sure gcc is found
Does this return correct value on win98???
Expand Down
12 changes: 6 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ def configuration(parent_package='',top_path=None):
if __name__ == '__main__':
from numpy.distutils.core import setup
from .weave_version import weave_version
setup(version = weave_version,
description = "Tools for inlining C/C++ in Python",
author = "Eric Jones",
author_email = "eric@enthought.com",
licence = "SciPy License (BSD Style)",
url = 'http://www.scipy.org',
setup(version=weave_version,
description="Tools for inlining C/C++ in Python",
author="Eric Jones",
author_email="eric@enthought.com",
licence="SciPy License (BSD Style)",
url='http://www.scipy.org',
**configuration(top_path='').todict())
12 changes: 6 additions & 6 deletions setupscons.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ def configuration(parent_package='',top_path=None):
if __name__ == '__main__':
from numpy.distutils.core import setup
from .weave_version import weave_version
setup(version = weave_version,
description = "Tools for inlining C/C++ in Python",
author = "Eric Jones",
author_email = "eric@enthought.com",
licence = "SciPy License (BSD Style)",
url = 'http://www.scipy.org',
setup(version=weave_version,
description="Tools for inlining C/C++ in Python",
author="Eric Jones",
author_email="eric@enthought.com",
licence="SciPy License (BSD Style)",
url='http://www.scipy.org',
**configuration(top_path='').todict())
2 changes: 1 addition & 1 deletion size_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def binary_op_size(xx,yy):
return res

class dummy_array(object):
def __init__(self,ary,ary_is_shape = 0,name=None):
def __init__(self,ary,ary_is_shape=0,name=None):
self.name = name
if ary_is_shape:
self.shape = ary
Expand Down
2 changes: 1 addition & 1 deletion standard_array_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def template_vars(self,inline=0):
res['cap_name'] = self.name.upper()
return res

def declaration_code(self,templatize = 0,inline=0):
def declaration_code(self,templatize=0,inline=0):
res = self.template_vars(inline=inline)
cap_name = self.name.upper()
res['cap_name'] = cap_name
Expand Down
Loading

0 comments on commit c986397

Please sign in to comment.