diff options
author | Jarrod Millman <millman@berkeley.edu> | 2007-10-29 14:58:18 +0000 |
---|---|---|
committer | Jarrod Millman <millman@berkeley.edu> | 2007-10-29 14:58:18 +0000 |
commit | 0b77f0e5f0e46b2ef7c570ebda046c34bbcc0f26 (patch) | |
tree | c7609a2a685fd5bff235d812b8c5705621216f4c | |
parent | aa3c27cce3d0625f719b812c9e6b0aa73114c612 (diff) | |
download | numpy-0b77f0e5f0e46b2ef7c570ebda046c34bbcc0f26.tar.gz |
ran reindent.py to clean up whitespace
39 files changed, 136 insertions, 147 deletions
diff --git a/numpy/core/memmap.py b/numpy/core/memmap.py index 1b007c957..56a44ba9c 100644 --- a/numpy/core/memmap.py +++ b/numpy/core/memmap.py @@ -100,5 +100,4 @@ class memmap(ndarray): try: self.close() except ValueError: - pass - + pass diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index 4c3047720..59d2169d0 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -658,8 +658,8 @@ def loadtxt(fname, dtype=float, comments='#', delimiter=None, converters=None, dtype - the data-type of the resulting array. If this is a record data-type, the the resulting array will be 1-d and each row will be interpreted as an element of the array. The number of columns - used must match the number of fields in the data-type in this case. - + used must match the number of fields in the data-type in this case. + comments - the character used to indicate the start of a comment in the file @@ -699,21 +699,21 @@ def loadtxt(fname, dtype=float, comments='#', delimiter=None, converters=None, dtype = multiarray.dtype(dtype) defconv = _getconv(dtype) - converterseq = None + converterseq = None if converters is None: converters = {} if dtype.names is not None: converterseq = [_getconv(dtype.fields[name][0]) \ for name in dtype.names] - + for i,line in enumerate(fh): if i<skiprows: continue line = line[:line.find(comments)].strip() if not len(line): continue vals = line.split(delimiter) if converterseq is None: - converterseq = [converters.get(j,defconv) \ - for j in xrange(len(vals))] + converterseq = [converters.get(j,defconv) \ + for j in xrange(len(vals))] if usecols is not None: row = [converterseq[j](vals[j]) for j in usecols] else: @@ -730,7 +730,7 @@ def loadtxt(fname, dtype=float, comments='#', delimiter=None, converters=None, else: return X -# adjust so that fmt can change across columns if desired. +# adjust so that fmt can change across columns if desired. def savetxt(fname, X, fmt='%.18e',delimiter=' '): """ @@ -776,7 +776,7 @@ def savetxt(fname, X, fmt='%.18e',delimiter=' '): X.shape = origShape - + @@ -894,10 +894,10 @@ def seterr(all=None, divide=None, over=None, under=None, invalid=None): >>> seterr(over='raise') # doctest: +SKIP {'over': 'ignore', 'divide': 'ignore', 'invalid': 'ignore', 'under': 'ignore'} - + >>> seterr(all='warn', over='raise') # doctest: +SKIP {'over': 'raise', 'divide': 'ignore', 'invalid': 'ignore', 'under': 'ignore'} - + >>> int16(32000) * int16(3) # doctest: +SKIP Traceback (most recent call last): File "<stdin>", line 1, in ? diff --git a/numpy/core/records.py b/numpy/core/records.py index ed5b55408..b86a71d7b 100644 --- a/numpy/core/records.py +++ b/numpy/core/records.py @@ -375,7 +375,7 @@ def fromrecords(recList, dtype=None, shape=None, formats=None, names=None, >>> r.col1 array([456, 2]) >>> r.col2 - chararray(['dbe', 'de'], + chararray(['dbe', 'de'], dtype='|S3') >>> import cPickle >>> print cPickle.loads(cPickle.dumps(r)) diff --git a/numpy/core/setup.py b/numpy/core/setup.py index de70b8703..a8fd46911 100644 --- a/numpy/core/setup.py +++ b/numpy/core/setup.py @@ -345,4 +345,3 @@ int main(int argc, char **argv) if __name__=='__main__': from numpy.distutils.core import setup setup(configuration=configuration) - diff --git a/numpy/core/tests/test_numeric.py b/numpy/core/tests/test_numeric.py index 891bf3be7..2f85c664e 100644 --- a/numpy/core/tests/test_numeric.py +++ b/numpy/core/tests/test_numeric.py @@ -275,13 +275,13 @@ class TestClip(NumpyTestCase): # use slow-clip selector = less(a, m)+2*greater(a, M) return selector.choose((a, m, M), out=out) - + # Handy functions def _generate_data(self, n, m): return randn(n, m) def _generate_data_complex(self, n, m): - return randn(n, m) + 1.j *rand(n, m) + return randn(n, m) + 1.j *rand(n, m) def _generate_flt_data(self, n, m): return (randn(n, m)).astype(float32) @@ -320,7 +320,7 @@ class TestClip(NumpyTestCase): def test_simple_int(self): """Test native int input with scalar min/max.""" a = self._generate_int_data(self.nr, self.nc) - a = a.astype(int) + a = a.astype(int) m = -2 M = 4 ac = self.fastclip(a, m, M) @@ -484,7 +484,7 @@ class TestClip(NumpyTestCase): def test_type_cast_02(self): "Test native int32 input with int32 scalar min/max." a = self._generate_int_data(self.nr, self.nc) - a = a.astype(int32) + a = a.astype(int32) m = -2 M = 4 ac = self.fastclip(a, m, M) @@ -507,7 +507,7 @@ class TestClip(NumpyTestCase): M = float32(4) act = self.fastclip(a,m,M) ac = self.clip(a,m,M) - assert_array_strict_equal(ac, act) + assert_array_strict_equal(ac, act) def test_type_cast_04(self): "Test native int32 with double arrays min/max." diff --git a/numpy/distutils/ccompiler.py b/numpy/distutils/ccompiler.py index 593833a76..b6cb1eb57 100644 --- a/numpy/distutils/ccompiler.py +++ b/numpy/distutils/ccompiler.py @@ -217,7 +217,7 @@ def CCompiler_customize(self, dist, need_cxx=0): + self.compiler[1:] else: if hasattr(self,'compiler'): - log.warn("#### %s #######" % (self.compiler,)) + log.warn("#### %s #######" % (self.compiler,)) log.warn('Missing compiler_cxx fix for '+self.__class__.__name__) return diff --git a/numpy/distutils/command/build_src.py b/numpy/distutils/command/build_src.py index d634d4420..8b1e7fe7a 100644 --- a/numpy/distutils/command/build_src.py +++ b/numpy/distutils/command/build_src.py @@ -116,7 +116,7 @@ class build_src(build_ext.build_ext): self.swig_cpp = build_ext.swig_cpp for c in ['swig','swig_opt']: o = '--'+c.replace('_','-') - v = getattr(build_ext,c,None) + v = getattr(build_ext,c,None) if v: if getattr(self,c): log.warn('both build_src and build_ext define %s option' % (o)) diff --git a/numpy/distutils/command/config.py b/numpy/distutils/command/config.py index 11d630993..41c8f4f02 100644 --- a/numpy/distutils/command/config.py +++ b/numpy/distutils/command/config.py @@ -156,4 +156,3 @@ class config(old_config): self._clean() return exitcode, output - diff --git a/numpy/distutils/core.py b/numpy/distutils/core.py index 5e2ab408b..a17e3fe50 100644 --- a/numpy/distutils/core.py +++ b/numpy/distutils/core.py @@ -98,23 +98,23 @@ def get_distribution(always=False): dist = distutils.dist.Distribution() return dist -def _exit_interactive_session(_cache=[]): - if _cache: - return # been here - _cache.append(1) - print '-'*72 - raw_input('Press ENTER to close the interactive session..') - print '='*72 +def _exit_interactive_session(_cache=[]): + if _cache: + return # been here + _cache.append(1) + print '-'*72 + raw_input('Press ENTER to close the interactive session..') + print '='*72 def setup(**attr): - if len(sys.argv)<=1 and not attr.get('script_args',[]): - from interactive import interactive_sys_argv - import atexit - atexit.register(_exit_interactive_session) - sys.argv[:] = interactive_sys_argv(sys.argv) - if len(sys.argv)>1: - return setup(**attr) + if len(sys.argv)<=1 and not attr.get('script_args',[]): + from interactive import interactive_sys_argv + import atexit + atexit.register(_exit_interactive_session) + sys.argv[:] = interactive_sys_argv(sys.argv) + if len(sys.argv)>1: + return setup(**attr) cmdclass = numpy_cmdclass.copy() diff --git a/numpy/distutils/fcompiler/__init__.py b/numpy/distutils/fcompiler/__init__.py index 3ef88f229..039d6fba8 100644 --- a/numpy/distutils/fcompiler/__init__.py +++ b/numpy/distutils/fcompiler/__init__.py @@ -207,7 +207,7 @@ class FCompiler(CCompiler): # This will be set by new_fcompiler when called in # command/{build_ext.py, build_clib.py, config.py} files. c_compiler = None - + def __init__(self, *args, **kw): CCompiler.__init__(self, *args, **kw) self.distutils_vars = self.distutils_vars.clone(self._environment_hook) diff --git a/numpy/distutils/misc_util.py b/numpy/distutils/misc_util.py index ca2b5204d..6f7dd1d83 100644 --- a/numpy/distutils/misc_util.py +++ b/numpy/distutils/misc_util.py @@ -1519,7 +1519,7 @@ else: #copied from python 2.5.1 distutils/msvccompiler.py def get_build_architecture(): """Return the processor architecture. - + Possible results are "Intel", "Itanium", or "AMD64". """ prefix = " bit (" diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py index c68308690..431180d4a 100644 --- a/numpy/distutils/system_info.py +++ b/numpy/distutils/system_info.py @@ -841,7 +841,7 @@ class lapack_mkl_info(mkl_info): lapack_libs = self.get_libs('lapack_libs',['mkl_lapack']) else: lapack_libs = self.get_libs('lapack_libs',['mkl_lapack32','mkl_lapack64']) - + info = {'libraries': lapack_libs} dict_append(info,**mkl) self.set_info(**info) @@ -1083,7 +1083,7 @@ class lapack_src_info(system_info): tgexc tgsen tgsja tgsna tgsy2 tgsyl tpcon tprfs tptri tptrs trcon trevc trexc trrfs trsen trsna trsyl trti2 trtri trtrs tzrqf tzrzf - + lacn2 lahr2 stemr laqr0 laqr1 laqr2 laqr3 laqr4 laqr5 ''' # [s|c|d|z]*.f sd_lasrc = ''' diff --git a/numpy/doc/example.py b/numpy/doc/example.py index d496e9fc2..26d140e5f 100644 --- a/numpy/doc/example.py +++ b/numpy/doc/example.py @@ -96,4 +96,3 @@ def otherfunc() : """ pass - diff --git a/numpy/f2py/cb_rules.py b/numpy/f2py/cb_rules.py index 25f8290e8..77acf9aa3 100644 --- a/numpy/f2py/cb_rules.py +++ b/numpy/f2py/cb_rules.py @@ -293,7 +293,7 @@ cb_arg_rules=[ }, 'strarglens':{isstring:',int #varname#_cb_len'}, # untested with multiple args 'strarglens_td':{isstring:',int'}, # untested with multiple args - 'strarglens_nm':{isstring:',#varname#_cb_len'}, # untested with multiple args + 'strarglens_nm':{isstring:',#varname#_cb_len'}, # untested with multiple args }, { # Scalars 'decl':{l_not(isintent_c):'\t#ctype# #varname#=(*#varname#_cb_capi);'}, diff --git a/numpy/f2py/lib/extgen/base.py b/numpy/f2py/lib/extgen/base.py index 35be0e161..0576f5844 100644 --- a/numpy/f2py/lib/extgen/base.py +++ b/numpy/f2py/lib/extgen/base.py @@ -65,7 +65,7 @@ class Component(object): return l return self._components components = property(components) - + def initialize(self, *components, **options): """ Set additional attributes, add components to instance, etc. @@ -86,7 +86,7 @@ class Component(object): def provides(self): """ Return a code idiom name that the current class defines. - + Used in avoiding redefinitions of functions and variables. """ if self._provides is None: @@ -123,7 +123,7 @@ class Component(object): r += Component._get_class_names(b) return r _get_class_names = staticmethod(_get_class_names) - + def add(self, component, container_label=None): """ Append component and its target container label to components list. @@ -205,7 +205,7 @@ class Component(object): return evaluated template strings. """ #self.finalize() - + # clean up containers self.containers = {} for n in dir(self): @@ -249,7 +249,7 @@ class Component(object): container = component.get_container(k) container.add(r, component.provides) else: - + self.warning('%s: no container label specified for component providing %r'\ % (self.__class__.__name__,component.provides)) component.parent = old_parent @@ -284,7 +284,7 @@ class Component(object): def get_container(self, name): """ Return named container. - + Rules for returning containers: (1) return local container if exists (2) return parent container if exists @@ -295,7 +295,7 @@ class Component(object): return self.containers[name] except KeyError: pass - + # parent container parent = self.parent while parent is not None: @@ -380,7 +380,7 @@ class Component(object): import numpy return numpy.__version__ numpy_version = property(numpy_version) - + class Container(object): """ Container of a list of named strings. @@ -401,7 +401,7 @@ class Container(object): >>> c += c2 >>> print c "hey, hoo, bar" - + """ __metaclass__ = ComponentMetaClass @@ -435,7 +435,7 @@ class Container(object): self.replace_map = replace_map self.ignore_empty_content = ignore_empty_content self.skip_prefix_suffix_when_single = skip_prefix_suffix_when_single - + def __nonzero__(self): return bool(self.list) @@ -452,7 +452,7 @@ class Container(object): for i,l in lst: self.add(other.list[i], l) else: - self.add(other) + self.add(other) return self __iadd__ = __add__ @@ -532,12 +532,12 @@ class Container(object): lst = [(i,l) for (l,i) in self.label_map.items()] lst.sort() for i,l in lst: - cpy.add(mapping(other.list[i]), l) + cpy.add(mapping(other.list[i]), l) return cpy def _test(): import doctest doctest.testmod() - + if __name__ == "__main__": _test() diff --git a/numpy/f2py/lib/extgen/c_support.py b/numpy/f2py/lib/extgen/c_support.py index baaca7d17..95ef1ac55 100644 --- a/numpy/f2py/lib/extgen/c_support.py +++ b/numpy/f2py/lib/extgen/c_support.py @@ -177,7 +177,7 @@ class CFunction(Component): %(CDeclaration)s %(CBody)s }''' - + container_options = dict( CArgument = dict(separator=', ', default='void'), CDeclaration = dict(default='<KILLLINE>', use_indent=True, ignore_empty_content=True, @@ -215,7 +215,7 @@ class CHeader(CLine): >>> h = CHeader('noddy.h') >>> print h.generate() #include "noddy.h" - + """ template = '#include "%(line)s"' @@ -288,6 +288,6 @@ extern \"C\" { def _test(): import doctest doctest.testmod() - + if __name__ == "__main__": _test() diff --git a/numpy/f2py/lib/extgen/py_support.py b/numpy/f2py/lib/extgen/py_support.py index af1619c98..2f69853b6 100644 --- a/numpy/f2py/lib/extgen/py_support.py +++ b/numpy/f2py/lib/extgen/py_support.py @@ -80,7 +80,7 @@ extern \"C\" { self.cdecl = PyCModuleCDeclaration(pyname) self += self.cdecl - + self.main = PyCModuleInitFunction(pyname) self += self.main map(self.add, components) @@ -93,7 +93,7 @@ extern \"C\" { def update_SetupPy(self, parent): parent.setup_py += self.evaluate(' config.add_extension(%(pyname)r, sources = ["%(extmodulesrc)s"])', extmodulesrc = self.path) - parent.init_py += 'import %s' % (self.pyname) + parent.init_py += 'import %s' % (self.pyname) def finalize(self): if self.need_numpy_support: @@ -113,7 +113,7 @@ if (PyErr_Occurred()) { def build(self, build_dir=None, clean_at_exit=None): """ build(build_dir=None, clean_at_exit=None) - + A convenience function to build, import, an return an extension module object. """ @@ -123,7 +123,7 @@ if (PyErr_Occurred()) { packagename = 'extgen_' + str(hex(int(time.time()*10000000)))[2:] build_dir = os.path.join(tempfile.gettempdir(), packagename) clean_at_exit = True - + setup = Component.SetupPy(build_dir) setup += self s,o = setup.execute('build_ext','--inplace') @@ -185,7 +185,7 @@ char extgen_module_doc[] = ) default_component_class_name = 'Line' - + def initialize(self, pyname): self.pyname = pyname return self @@ -225,8 +225,8 @@ class PyCModuleInitFunction(CFunction): } return; } - """ - + """ + template = '''\ %(CSpecifier)s %(CTypeSpec)s @@ -320,7 +320,7 @@ class FunctionSignature(Component): map(self.add, components) return self def update_containers(self): - self.container_OptExtArg += self.container_OptArg + self.container_ExtArg + self.container_OptExtArg += self.container_OptArg + self.container_ExtArg class PyCFunction(CFunction): @@ -329,7 +329,7 @@ class PyCFunction(CFunction): >>> f = PyCFunction('foo') >>> print f.generate() static - char pyc_function_foo_doc[] = + char pyc_function_foo_doc[] = \" foo() -> None\" \"\\n\\n:Returns:\\n None\" ; @@ -366,7 +366,7 @@ class PyCFunction(CFunction): template = '''\ static -char %(name)s_doc[] = +char %(name)s_doc[] = " %(FunctionSignature)s" %(Title)s %(Description)s @@ -399,7 +399,7 @@ PyObject* }''' container_options = CFunction.container_options.copy() - + container_options.update(\ TMP = dict(), @@ -429,13 +429,13 @@ PyObject* ReqKWList = ReqKWList.parent_container_options, OptKWList = OptKWList.parent_container_options, ExtKWList = ExtKWList.parent_container_options, - + ReqArgFmt = ReqArgFmt.parent_container_options, OptArgFmt = OptArgFmt.parent_container_options, ExtArgFmt = ExtArgFmt.parent_container_options, OptExtArgFmt = OptExtArgFmt.ExtArgFmt.parent_container_options, RetArgFmt = ExtArgFmt.parent_container_options, - + ReqArgObj = ReqArgObj.parent_container_options, OptArgObj = OptArgObj.parent_container_options, ExtArgObj = ExtArgObj.parent_container_options, @@ -443,7 +443,7 @@ PyObject* FromPyObj = CCode.parent_container_options, PyObjFrom = CCode.parent_container_options, - + CleanPyObjFrom = dict(default='<KILLLINE>', reverse=True, use_indent=True, ignore_empty_content=True), CleanCBody = dict(default='<KILLLINE>', reverse=True, use_indent=True, ignore_empty_content=True), CleanFromPyObj = dict(default='<KILLLINE>', reverse=True, use_indent=True, ignore_empty_content=True), @@ -457,7 +457,7 @@ PyObject* PyCArgument = 'TMP', CCode = 'CBody', ) - + def initialize(self, pyname, *components, **options): self.pyname = pyname self.title = options.pop('title', None) @@ -483,7 +483,7 @@ PyObject* t = ' {"%(pyname)s", (PyCFunction)%(name)s, METH_VARARGS | METH_KEYWORDS, %(name)s_doc}' parent.cdecl.add(self.evaluate(t),'PyMethodDef') parent.cdecl.add(self.signature,'FunctionSignature') - + def update_containers(self): self.container_OptExtArg += self.container_OptArg + self.container_ExtArg self.container_OptExtArgFmt += self.container_OptArgFmt + self.container_ExtArgFmt @@ -585,7 +585,7 @@ class PyCArgument(Component): if self.output_description is None: self.output_description = description if options: self.warning('%s unused options: %s\n' % (self.__class__.__name__, options)) - + self.name = name self.ctype = ctype = PyCTypeSpec(ctype) self += ctype @@ -613,8 +613,8 @@ class PyCArgument(Component): self.retpycvar = name + '_pyc_r' ctype.set_titles(self) - - map(self.add, components) + + map(self.add, components) return self def __repr__(self): @@ -668,7 +668,7 @@ class PyCArgument(Component): pass else: raise NotImplementedError('input_intent=%r' % (self.input_intent)) - + if self.output_intent=='return': parent += RetArg(self.name) parent.signature += RetArg(self.name) @@ -679,11 +679,11 @@ class PyCArgument(Component): elif self.output_intent=='hide': pass else: - raise NotImplementedError('output_intent=%r' % (self.output_intent)) + raise NotImplementedError('output_intent=%r' % (self.output_intent)) class PyCReturn(PyCArgument): - def initialize(self, name, ctype = object, *components, **options): + def initialize(self, name, ctype = object, *components, **options): return PyCArgument(name, ctype, input_intent='hide', output_intent='return', *components, **options) class PyCTypeSpec(CTypeSpec): @@ -898,7 +898,7 @@ class PyCTypeSpec(CTypeSpec): c_long = (None,'long', 'l', 'l', '0'), c_unsigned_long = (None,'unsigned long', 'k', 'k', '0'), c_long_long = (None,'PY_LONG_LONG', 'L', 'L', '0'), - c_unsigned_long_long = (None,'unsigned PY_LONG_LONG', 'K', 'K', '0'), + c_unsigned_long_long = (None,'unsigned PY_LONG_LONG', 'K', 'K', '0'), c_Py_ssize_t = (None,'Py_ssize_t', 'n', 'n', '0'), c_char1 = (None,'char', 'c', 'c', '"\\0"'), c_float = (None,'float', 'f', 'f', '0.0'), @@ -911,7 +911,7 @@ class PyCTypeSpec(CTypeSpec): def initialize(self, typeobj): if isinstance(typeobj, self.__class__): return typeobj - + m = self.typeinfo_map key = None @@ -955,7 +955,7 @@ class PyCTypeSpec(CTypeSpec): #self.add(Component.get('import_array'), 'ModuleInit') if key.startswith('numeric_'): raise NotImplementedError(self.__class__.__name__ + ': Numeric support') - + return self def finalize(self): @@ -1099,6 +1099,6 @@ if (!(%(retpycvar)s==%(pycvar)s)) { def _test(): import doctest doctest.testmod() - + if __name__ == "__main__": _test() diff --git a/numpy/f2py/lib/extgen/setup_py.py b/numpy/f2py/lib/extgen/setup_py.py index 665ef5619..da1d84943 100644 --- a/numpy/f2py/lib/extgen/setup_py.py +++ b/numpy/f2py/lib/extgen/setup_py.py @@ -51,7 +51,7 @@ class SetupPy(Component): >>> import SetupPy_doctest as mypackage >>> print mypackage.foo.__doc__ #doctest: +ELLIPSIS This module 'foo' is generated with ExtGen from NumPy version... - + """ template_setup_py_start = '''\ def configuration(parent_package='', top_path = ''): @@ -88,7 +88,7 @@ if __name__ == "__main__": self += init_py self += setup_py - + map(self.add, components) return self @@ -115,10 +115,10 @@ if __name__ == "__main__": self.info('leaving %r directory' % (self.path)) return r - + def _test(): import doctest doctest.testmod() - + if __name__ == "__main__": _test() diff --git a/numpy/f2py/lib/extgen/utils.py b/numpy/f2py/lib/extgen/utils.py index b3666c8f6..aa156469f 100644 --- a/numpy/f2py/lib/extgen/utils.py +++ b/numpy/f2py/lib/extgen/utils.py @@ -104,7 +104,7 @@ class FileSource(Component): Line = 'Content', Code = 'Content', ) - + def initialize(self, path, *components, **options): self.path = path map(self.add, components) @@ -121,6 +121,6 @@ class FileSource(Component): def _test(): import doctest doctest.testmod() - + if __name__ == "__main__": _test() diff --git a/numpy/f2py/lib/main.py b/numpy/f2py/lib/main.py index 6c2e1415e..de34895e5 100644 --- a/numpy/f2py/lib/main.py +++ b/numpy/f2py/lib/main.py @@ -418,7 +418,7 @@ def build_extension(sys_argv, sources_only = False): '--build-clib',build_dir_clib_clib, ] temp_dirs = [build_dir_ext_temp, build_dir_clib_temp, build_dir_clib_clib] - + if fc_flags: new_sys_argv += ['config_fc'] + fc_flags sys.argv[:] = new_sys_argv @@ -492,7 +492,7 @@ def compile(source, if source_ext is None: reader = get_reader(source) source_ext = {'free90':'.f90','fix90':'.f90','fix77':'.f','pyf':'.pyf'}[reader.mode] - + if modulenames is None: modulenames = jobname, if os.path.isdir(tmpdir): diff --git a/numpy/f2py/lib/py_wrap_type.py b/numpy/f2py/lib/py_wrap_type.py index 7b90e7ed1..1c7d8f309 100644 --- a/numpy/f2py/lib/py_wrap_type.py +++ b/numpy/f2py/lib/py_wrap_type.py @@ -453,12 +453,12 @@ static PyTypeObject %(otype)sType = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ "Fortran derived type %(name)s objects", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ %(otype)s_methods, /* tp_methods */ 0 /*%(otype)s_members*/, /* tp_members */ %(otype)s_getseters, /* tp_getset */ diff --git a/numpy/f2py/lib/tests/test_module_module.py b/numpy/f2py/lib/tests/test_module_module.py index 0f0e88cc9..d56cb45a6 100644 --- a/numpy/f2py/lib/tests/test_module_module.py +++ b/numpy/f2py/lib/tests/test_module_module.py @@ -42,7 +42,7 @@ module test_module_module_ext type(rat) a print*,"In bar,a=",a end subroutine bar -end module test_module_module_ext +end module test_module_module_ext ''' m,m2 = compile(fortran_code, modulenames=['test_module_module_ext', diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index 2d7bc6189..0463c48f5 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -1,7 +1,7 @@ __docformat__ = "restructuredtext en" __all__ = ['logspace', 'linspace', 'select', 'piecewise', 'trim_zeros', - 'copy', 'iterable', + 'copy', 'iterable', 'diff', 'gradient', 'angle', 'unwrap', 'sort_complex', 'disp', 'unique', 'extract', 'place', 'nansum', 'nanmax', 'nanargmax', 'nanargmin', 'nanmin', 'vectorize', 'asarray_chkfinite', 'average', diff --git a/numpy/lib/index_tricks.py b/numpy/lib/index_tricks.py index 8e6f36e30..26a44976c 100644 --- a/numpy/lib/index_tricks.py +++ b/numpy/lib/index_tricks.py @@ -125,7 +125,7 @@ class nd_grid(object): [2], [3], [4]]), array([[0, 1, 2, 3, 4]])] - + """ def __init__(self, sparse=False): self.sparse = sparse @@ -319,7 +319,7 @@ class r_class(concatenator): For example: >>> r_[array([1,2,3]), 0, 0, array([4,5,6])] array([1, 2, 3, 0, 0, 4, 5, 6]) - + """ def __init__(self): concatenator.__init__(self, 0) diff --git a/numpy/lib/shape_base.py b/numpy/lib/shape_base.py index 95b2bf2ce..9ac77666f 100644 --- a/numpy/lib/shape_base.py +++ b/numpy/lib/shape_base.py @@ -299,7 +299,7 @@ def dstack(tup): [[2, 3]], <BLANKLINE> [[3, 4]]]) - + """ return _nx.concatenate(map(atleast_3d,tup),2) diff --git a/numpy/lib/tests/test_shape_base.py b/numpy/lib/tests/test_shape_base.py index c819ba366..320871a95 100644 --- a/numpy/lib/tests/test_shape_base.py +++ b/numpy/lib/tests/test_shape_base.py @@ -410,4 +410,3 @@ def compare_results(res,desired): if __name__ == "__main__": NumpyTest().run() - diff --git a/numpy/lib/twodim_base.py b/numpy/lib/twodim_base.py index a067139af..4852097f3 100644 --- a/numpy/lib/twodim_base.py +++ b/numpy/lib/twodim_base.py @@ -143,7 +143,7 @@ def vander(x, N=None): X[:,i] = x**(N-i-1) return X - + def histogram2d(x,y, bins=10, range=None, normed=False, weights=None): """histogram2d(x,y, bins=10, range=None, normed=False) -> H, xedges, yedges @@ -151,27 +151,27 @@ def histogram2d(x,y, bins=10, range=None, normed=False, weights=None): :Parameters: - `x,y` : Sample arrays (1D). - - `bins` : Number of bins -or- [nbin x, nbin y] -or- + - `bins` : Number of bins -or- [nbin x, nbin y] -or- [bin edges] -or- [x bin edges, y bin edges]. - `range` : A sequence of lower and upper bin edges (default: [min, max]). - `normed` : Boolean, if False, return the number of samples in each bin, if True, returns the density. - - `weights` : An array of weights. The weights are normed only if normed + - `weights` : An array of weights. The weights are normed only if normed is True. Should weights.sum() not equal N, the total bin count \ will not be equal to the number of samples. - + :Return: - `hist` : Histogram array. - - `xedges, yedges` : Arrays defining the bin edges. - + - `xedges, yedges` : Arrays defining the bin edges. + Example: >>> x = random.randn(100,2) >>> hist2d, xedges, yedges = histogram2d(x, bins = (6, 7)) - + :SeeAlso: histogramdd """ from numpy import histogramdd - + try: N = len(bins) except TypeError: diff --git a/numpy/lib/type_check.py b/numpy/lib/type_check.py index 60c84e335..20817ab01 100644 --- a/numpy/lib/type_check.py +++ b/numpy/lib/type_check.py @@ -7,7 +7,7 @@ __all__ = ['iscomplexobj','isrealobj','imag','iscomplex', import numpy.core.numeric as _nx from numpy.core.numeric import asarray, asanyarray, array, isnan, \ - obj2sctype, zeros + obj2sctype, zeros from ufunclike import isneginf, isposinf _typecodes_by_elsize = 'GDFgdfQqLlIiHhBb?' diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py index fa69e6718..386506bd6 100644 --- a/numpy/lib/utils.py +++ b/numpy/lib/utils.py @@ -118,7 +118,7 @@ def byte_bounds(a): high is just *past* the last byte If the array is not single-segment, then it may not actually - use every byte between these bounds. + use every byte between these bounds. The array provided must conform to the Python-side of the array interface """ @@ -140,7 +140,7 @@ def byte_bounds(a): a_high += (shape-1)*stride a_high += bytes_a return a_low, a_high - + def may_share_memory(a, b): """Determine if two arrays can share memory @@ -275,7 +275,7 @@ def info(object=None,maxwidth=76,output=sys.stdout,toplevel='numpy'): Example: >>> from numpy import * >>> info(polyval) # doctest: +SKIP - + polyval(p, x) Evaluate the polymnomial p at x. diff --git a/numpy/linalg/lapack_lite/clapack_scrub.py b/numpy/linalg/lapack_lite/clapack_scrub.py index df00851c3..1b26c23e4 100644 --- a/numpy/linalg/lapack_lite/clapack_scrub.py +++ b/numpy/linalg/lapack_lite/clapack_scrub.py @@ -273,4 +273,3 @@ if __name__ == '__main__': writefo = open(outfilename, 'w') writefo.write(source) writefo.close() - diff --git a/numpy/matlib.py b/numpy/matlib.py index 413a45ee2..cfc61f4f6 100644 --- a/numpy/matlib.py +++ b/numpy/matlib.py @@ -45,7 +45,7 @@ def rand(*args): def randn(*args): if isinstance(args[0], tuple): - args = args[0] + args = args[0] return asmatrix(N.random.randn(*args)) def repmat(a, m, n): diff --git a/numpy/numarray/image.py b/numpy/numarray/image.py index e24326f79..323528905 100644 --- a/numpy/numarray/image.py +++ b/numpy/numarray/image.py @@ -12,4 +12,3 @@ http://svn.scipy.org/svn/scipy/trunk/Lib/stsci or by downloading and installing all of SciPy from http://www.scipy.org. """ raise ImportError(msg) - diff --git a/numpy/numarray/matrix.py b/numpy/numarray/matrix.py index a39812e1f..86d79bbe2 100644 --- a/numpy/numarray/matrix.py +++ b/numpy/numarray/matrix.py @@ -5,4 +5,3 @@ from numpy import matrix as _matrix def Matrix(data, typecode=None, copy=1, savespace=0): return _matrix(data, typecode, copy=copy) - diff --git a/numpy/numarray/numerictypes.py b/numpy/numarray/numerictypes.py index 490ced970..1e9cbb4a7 100644 --- a/numpy/numarray/numerictypes.py +++ b/numpy/numarray/numerictypes.py @@ -472,25 +472,25 @@ if HasUInt64: Complex64 : Complex64 } else: - _MaximumType = { - Bool : Int64, + _MaximumType = { + Bool : Int64, - Int8 : Int64, - Int16 : Int64, - Int32 : Int64, - Int64 : Int64, + Int8 : Int64, + Int16 : Int64, + Int32 : Int64, + Int64 : Int64, - UInt8 : Int64, - UInt16 : Int64, - UInt32 : Int64, - UInt8 : Int64, + UInt8 : Int64, + UInt16 : Int64, + UInt32 : Int64, + UInt8 : Int64, - Float32 : Float64, - Float64 : Float64, + Float32 : Float64, + Float64 : Float64, - Complex32 : Complex64, - Complex64 : Complex64 - } + Complex32 : Complex64, + Complex64 : Complex64 + } def MaximumType(t): """returns the type of highest precision of the same general kind as 't'""" diff --git a/numpy/oldnumeric/arrayfns.py b/numpy/oldnumeric/arrayfns.py index e80246a57..4c31a6827 100644 --- a/numpy/oldnumeric/arrayfns.py +++ b/numpy/oldnumeric/arrayfns.py @@ -94,5 +94,3 @@ def to_corners(arr, nv, nvsum): def construct3(mask, itype): raise NotImplementedError - - diff --git a/numpy/oldnumeric/ma.py b/numpy/oldnumeric/ma.py index 857c554ec..601ff88af 100644 --- a/numpy/oldnumeric/ma.py +++ b/numpy/oldnumeric/ma.py @@ -12,4 +12,3 @@ def average(a, axis=0, weights=None, returned=0): def take(a, indices, axis=0): return nca.average(a, indices, axis=0) - diff --git a/numpy/oldnumeric/random_array.py b/numpy/oldnumeric/random_array.py index 94c54603f..73564811d 100644 --- a/numpy/oldnumeric/random_array.py +++ b/numpy/oldnumeric/random_array.py @@ -81,13 +81,13 @@ def multivariate_normal(mean, cov, shape=[]): """multivariate_normal(mean, cov) or multivariate_normal(mean, cov, [m, n, ...]) returns an array containing multivariate normally distributed random numbers with specified mean and covariance. - + mean must be a 1 dimensional array. cov must be a square two dimensional array with the same number of rows and columns as mean has elements. - + The first form returns a single 1-D array containing a multivariate normal. - + The second form returns an array of shape (m, n, ..., cov.shape[0]). In this case, output[i,j,...,:] is a 1-D array containing a multivariate normal.""" diff --git a/numpy/testing/numpytest.py b/numpy/testing/numpytest.py index d65074247..3ea5686aa 100644 --- a/numpy/testing/numpytest.py +++ b/numpy/testing/numpytest.py @@ -296,10 +296,10 @@ class NumpyTest: def rename(self, **kws): """Apply renaming submodule test file test_<name>.py to test_<newname>.py. - + Usage: self.rename(name='newname') before calling the self.test() method. - + If 'newname' is None, then no tests will be executed for a given module. """ @@ -45,12 +45,12 @@ def configuration(parent_package='',top_path=None): assume_default_configuration=True, delegate_options_to_subpackages=True, quiet=True) - + config.add_subpackage('numpy') - + config.add_data_files(('numpy','*.txt'), ('numpy','COMPATIBILITY'), - ('numpy','scipy_compatibility'), + ('numpy','scipy_compatibility'), ('numpy','site.cfg.example')) config.get_version('numpy/version.py') # sets config.version @@ -79,7 +79,7 @@ def setup_package(): classifiers=filter(None, CLASSIFIERS.split('\n')), author = "Travis E. Oliphant, et.al.", author_email = "oliphant@ee.byu.edu", - platforms = ["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"], + platforms = ["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"], configuration=configuration ) finally: del sys.path[0] |