[Numpy-svn] r4775 - in trunk: benchmarks numpy numpy/core numpy/core/code_generators numpy/distutils numpy/distutils/command numpy/doc numpy/fft numpy/lib numpy/lib/tests numpy/linalg numpy/random

numpy-svn@scip... numpy-svn@scip...
Fri Feb 8 04:54:27 CST 2008


Author: jarrod.millman
Date: 2008-02-08 04:54:01 -0600 (Fri, 08 Feb 2008)
New Revision: 4775

Modified:
   trunk/benchmarks/simpleindex.py
   trunk/numpy/_import_tools.py
   trunk/numpy/add_newdocs.py
   trunk/numpy/core/code_generators/generate_ufunc_api.py
   trunk/numpy/core/defmatrix.py
   trunk/numpy/core/numeric.py
   trunk/numpy/core/records.py
   trunk/numpy/core/scons_support.py
   trunk/numpy/core/setup.py
   trunk/numpy/core/setupscons.py
   trunk/numpy/distutils/command/scons.py
   trunk/numpy/distutils/misc_util.py
   trunk/numpy/doc/example.py
   trunk/numpy/fft/setupscons.py
   trunk/numpy/lib/arraysetops.py
   trunk/numpy/lib/format.py
   trunk/numpy/lib/io.py
   trunk/numpy/lib/scimath.py
   trunk/numpy/lib/setupscons.py
   trunk/numpy/lib/tests/test_format.py
   trunk/numpy/lib/utils.py
   trunk/numpy/linalg/linalg.py
   trunk/numpy/linalg/setupscons.py
   trunk/numpy/random/setupscons.py
Log:
ran reindent


Modified: trunk/benchmarks/simpleindex.py
===================================================================
--- trunk/benchmarks/simpleindex.py	2008-02-08 10:17:57 UTC (rev 4774)
+++ trunk/benchmarks/simpleindex.py	2008-02-08 10:54:01 UTC (rev 4775)
@@ -46,4 +46,3 @@
 print "Numarray: ", numarray_timer.repeat(3,100)
 print "Python: ", python_timer.repeat(3,100)
 print "Optimized: ", numpy_timer3.repeat(3,100)
-

Modified: trunk/numpy/_import_tools.py
===================================================================
--- trunk/numpy/_import_tools.py	2008-02-08 10:17:57 UTC (rev 4774)
+++ trunk/numpy/_import_tools.py	2008-02-08 10:54:01 UTC (rev 4775)
@@ -152,10 +152,10 @@
 
        Parameters
        ----------
-        *packges : arg-tuple 
+        *packges : arg-tuple
              the names (one or more strings) of all the modules one
              wishes to load into the top-level namespace.
-        verbose= : integer 
+        verbose= : integer
              verbosity level [default: -1].
              verbose=-1 will suspend also warnings.
         force= : bool

Modified: trunk/numpy/add_newdocs.py
===================================================================
--- trunk/numpy/add_newdocs.py	2008-02-08 10:17:57 UTC (rev 4774)
+++ trunk/numpy/add_newdocs.py	2008-02-08 10:54:01 UTC (rev 4775)
@@ -1,7 +1,7 @@
 # This is only meant to add docs to
 #  objects defined in C-extension modules.
 # The purpose is to allow easier editing of the
-#  docstrings without requiring a re-compile. 
+#  docstrings without requiring a re-compile.
 from lib import add_newdoc
 
 add_newdoc('numpy.core','dtype',
@@ -238,7 +238,7 @@
         open file object or string containing file name.
     dtype : data-type
         data type of the returned array
-    count : int 
+    count : int
         number of items to read (-1 mean 'all')
     sep : string
         separater between items if file is a text file (default "")
@@ -1107,8 +1107,8 @@
     is done if the array is not of float type and 'decimals' is >= 0.
 
     The keyword 'out' may be used to specify a different array to hold the
-    result rather than the default new array. If the type of the array 
-    specified by 'out' differs from that of 'a', the result is cast to the 
+    result rather than the default new array. If the type of the array
+    specified by 'out' differs from that of 'a', the result is cast to the
     new type, otherwise the original type is kept. Floats round to floats
     by default.
 
@@ -1209,7 +1209,7 @@
     |'heapsort' |   3   | O(n*log(n)) |     0      |   no  |
     |------------------------------------------------------|
 
-    All the sort algorithms make temporary copies of the data when the sort is 
+    All the sort algorithms make temporary copies of the data when the sort is
     not along the last axis. Consequently, sorts along the last axis are faster
     and use less space than sorts along other axis.
     """))

Modified: trunk/numpy/core/code_generators/generate_ufunc_api.py
===================================================================
--- trunk/numpy/core/code_generators/generate_ufunc_api.py	2008-02-08 10:17:57 UTC (rev 4774)
+++ trunk/numpy/core/code_generators/generate_ufunc_api.py	2008-02-08 10:54:01 UTC (rev 4775)
@@ -71,7 +71,7 @@
 
 def generate_api(output_dir, force=False):
     basename = 'ufunc_api'
-    
+
     h_file = os.path.join(output_dir, '__%s.h' % basename)
     c_file = os.path.join(output_dir, '__%s.c' % basename)
     d_file = os.path.join(output_dir, '%s.txt' % basename)

Modified: trunk/numpy/core/defmatrix.py
===================================================================
--- trunk/numpy/core/defmatrix.py	2008-02-08 10:17:57 UTC (rev 4774)
+++ trunk/numpy/core/defmatrix.py	2008-02-08 10:54:01 UTC (rev 4775)
@@ -51,16 +51,16 @@
 class matrix(N.ndarray):
     """mat = matrix(data, dtype=None, copy=True)
 
-    Returns a matrix from an array-like object, or a string of 
+    Returns a matrix from an array-like object, or a string of
     data.  A matrix is a specialized 2-d array that retains
     it's 2-d nature through operations and where '*' means matrix
-    multiplication and '**' means matrix power. 
+    multiplication and '**' means matrix power.
 
     Parameters
     ----------
     data : array-like or string
-       If data is a string, then interpret the string as a matrix 
-         with commas or spaces separating columns and semicolons 
+       If data is a string, then interpret the string as a matrix
+         with commas or spaces separating columns and semicolons
          separating rows.
        If data is array-like than convert the array to a matrix.
     dtype : data-type
@@ -273,7 +273,7 @@
         the flattened array by default, otherwise over the specified axis.
 
         Parameters
-        ----------        
+        ----------
         axis : integer
             Axis along which the means are computed. The default is
             to compute the standard deviation of the flattened array.
@@ -289,7 +289,7 @@
             cast if necessary.
 
         Returns
-        -------        
+        -------
         mean : The return type varies, see above.
             A new array holding the result is returned unless out is
             specified, in which case a reference to out is returned.
@@ -342,7 +342,7 @@
         mean : average
 
         Notes
-        ----- 
+        -----
         The standard deviation is the square root of the
         average of the squared deviations from the mean, i.e. var =
         sqrt(mean((x - x.mean())**2)).  The computed standard
@@ -362,7 +362,7 @@
         ----------
         axis : integer
             Axis along which the variance is computed. The default is to
-            compute the variance of the flattened array.            
+            compute the variance of the flattened array.
         dtype : data-type
             Type to use in computing the variance. For arrays of integer
             type the default is float32, for arrays of float types it is

Modified: trunk/numpy/core/numeric.py
===================================================================
--- trunk/numpy/core/numeric.py	2008-02-08 10:17:57 UTC (rev 4774)
+++ trunk/numpy/core/numeric.py	2008-02-08 10:54:01 UTC (rev 4775)
@@ -149,7 +149,7 @@
 
 def require(a, dtype=None, requirements=None):
     """Return an ndarray of the provided type that satisfies requirements.
-    
+
     This function is useful to be sure that an array with the correct flags
     is returned for passing to compiled code (perhaps through ctypes).
 
@@ -160,7 +160,7 @@
      dtype : data-type
        The required data-type (None is the default data-type -- float64)
      requirements : list of strings
-       The requirements list can be any of the 
+       The requirements list can be any of the
        'ENSUREARRAY' ('E')  - ensure that  a base-class ndarray
        'F_CONTIGUOUS' ('F') - ensure a Fortran-contiguous array
        'C_CONTIGUOUS' ('C') - ensure a C-contiguous array
@@ -169,7 +169,7 @@
        'OWNDATA' ('O')      - ensure an array that owns its own data
 
        The returned array will be guaranteed to have the listed requirements
-       by making a copy if needed. 
+       by making a copy if needed.
     """
     if requirements is None:
         requirements = []
@@ -276,7 +276,7 @@
 try:
     # importing this changes the dot function for basic 4 types
     # to blas-optimized versions.
-    from _dotblas import dot, vdot, inner, alterdot, restoredot    
+    from _dotblas import dot, vdot, inner, alterdot, restoredot
 except ImportError:
     def alterdot():
         "Does Nothing"

Modified: trunk/numpy/core/records.py
===================================================================
--- trunk/numpy/core/records.py	2008-02-08 10:17:57 UTC (rev 4774)
+++ trunk/numpy/core/records.py	2008-02-08 10:54:01 UTC (rev 4775)
@@ -45,9 +45,9 @@
 class format_parser:
     """Class to convert formats, names, titles description to a dtype
 
-    After constructing the format_parser object, the dtype attribute is 
+    After constructing the format_parser object, the dtype attribute is
       the converted data-type.
-    
+
     dtype = format_parser(formats, names, titles).dtype
 
     Parameters
@@ -59,18 +59,18 @@
         comma-separated field names --- 'col1, col2, col3'
         list or tuple of field names
     titles : sequence
-        sequence of title strings or unicode        
+        sequence of title strings or unicode
     aligned : bool
         align the fields by padding as the C-compiler would
-    byteorder : 
-        If specified, all the fields will be changed to the 
+    byteorder :
+        If specified, all the fields will be changed to the
         provided byteorder.  Otherwise, the default byteorder is
         used.
 
     Returns
     -------
     object
-        A Python object whose dtype attribute is a data-type. 
+        A Python object whose dtype attribute is a data-type.
     """
     def __init__(self, formats, names, titles, aligned=False, byteorder=None):
         self._parseFormats(formats, aligned)
@@ -227,9 +227,9 @@
         by the *formats*, *names*, *titles*, *aligned*, and *byteorder* keywords.
     buf : [buffer] or None
         If this is None, then a new array is created of the given shape and data-type
-        If this is an object exposing the buffer interface, then the array will 
-        use the memory from an existing buffer.  In this case, the *offset* and 
-        *strides* keywords can also be used. 
+        If this is an object exposing the buffer interface, then the array will
+        use the memory from an existing buffer.  In this case, the *offset* and
+        *strides* keywords can also be used.
 
     See Also
     --------

Modified: trunk/numpy/core/scons_support.py
===================================================================
--- trunk/numpy/core/scons_support.py	2008-02-08 10:17:57 UTC (rev 4774)
+++ trunk/numpy/core/scons_support.py	2008-02-08 10:54:01 UTC (rev 4775)
@@ -30,12 +30,12 @@
 # Ufunc and multiarray API generators
 #------------------------------------
 def do_generate_array_api(target, source, env):
-    nowrap_do_generate_array_api([str(i) for i in target], 
+    nowrap_do_generate_array_api([str(i) for i in target],
                                  [str(i) for i in source])
     return 0
 
 def do_generate_ufunc_api(target, source, env):
-    nowrap_do_generate_ufunc_api([str(i) for i in target], 
+    nowrap_do_generate_ufunc_api([str(i) for i in target],
                                  [str(i) for i in source])
     return 0
 
@@ -74,7 +74,7 @@
     base, ext = split_ext(pbasename(str(source[0])))
     t = pjoin(pdirname(str(target[0])), base)
     return ([t], source)
-    
+
 #----------------
 # umath generator
 #----------------
@@ -92,7 +92,7 @@
 def generate_umath_emitter(target, source, env):
     t = str(target[0]) + '.c'
     return ([t], source)
-    
+
 #-----------------------------------------
 # Other functions related to configuration
 #-----------------------------------------

Modified: trunk/numpy/core/setup.py
===================================================================
--- trunk/numpy/core/setup.py	2008-02-08 10:17:57 UTC (rev 4774)
+++ trunk/numpy/core/setup.py	2008-02-08 10:54:01 UTC (rev 4775)
@@ -175,7 +175,7 @@
                       " python-dev|python-devel." % (python_h)
 
             config.numpy_include_dirs
-            result = config_cmd.try_run(testcode, 
+            result = config_cmd.try_run(testcode,
                                 include_dirs = [python_include] + \
                                                        config.numpy_include_dirs,
                                         library_dirs = default_lib_dirs)
@@ -190,7 +190,7 @@
             target_f.close()
             print 'EOF'
         return target
-                                
+
     def generate_api_func(module_name):
         def generate_api(ext, build_dir):
             script = join(codegen_dir, module_name + '.py')
@@ -405,9 +405,9 @@
 #include "config.h"
 
 int main()
-{   
+{
     FILE* f;
-   
+
     f = fopen("%s", "w");
     if (f == NULL) {
         return -1;

Modified: trunk/numpy/core/setupscons.py
===================================================================
--- trunk/numpy/core/setupscons.py	2008-02-08 10:17:57 UTC (rev 4774)
+++ trunk/numpy/core/setupscons.py	2008-02-08 10:54:01 UTC (rev 4775)
@@ -25,10 +25,10 @@
                       join('code_generators', 'multiarray_api_order.txt'),
                       join('code_generators', 'ufunc_api_order.txt')]
     core_src = [join('src', basename(i)) for i in glob.glob(join(local_dir,
-                                                                'src', 
+                                                                'src',
                                                                 '*.c'))]
     core_src += [join('src', basename(i)) for i in glob.glob(join(local_dir,
-                                                                 'src', 
+                                                                 'src',
                                                                  '*.src'))]
 
     source_files = dot_blas_src + api_definition + core_src + \
@@ -54,7 +54,7 @@
         incl_dir = os.path.dirname(target)
         if incl_dir not in config.numpy_include_dirs:
             config.numpy_include_dirs.append(incl_dir)
-        config.add_data_files((header_dir, target)) 
+        config.add_data_files((header_dir, target))
 
     def add_array_api():
         scons_build_dir = get_scons_build_dir()
@@ -83,7 +83,7 @@
         add_ufunc_api()
         config.add_configres()
 
-    config.add_sconscript('SConstruct', 
+    config.add_sconscript('SConstruct',
                           post_hook = add_generated_files,
                           source_files = source_files)
 

Modified: trunk/numpy/distutils/command/scons.py
===================================================================
--- trunk/numpy/distutils/command/scons.py	2008-02-08 10:17:57 UTC (rev 4774)
+++ trunk/numpy/distutils/command/scons.py	2008-02-08 10:54:01 UTC (rev 4775)
@@ -14,21 +14,21 @@
 
 def get_scons_build_dir():
     """Return the top path where everything produced by scons will be put.
-    
+
     The path is relative to the top setup.py"""
     from numscons import get_scons_build_dir
     return get_scons_build_dir()
 
 def get_scons_configres_dir():
     """Return the top path where everything produced by scons will be put.
-    
+
     The path is relative to the top setup.py"""
     from numscons import get_scons_configres_dir
     return get_scons_configres_dir()
 
 def get_scons_configres_filename():
     """Return the top path where everything produced by scons will be put.
-    
+
     The path is relative to the top setup.py"""
     from numscons import get_scons_configres_filename
     return get_scons_configres_filename()
@@ -101,7 +101,7 @@
 def get_compiler_executable(compiler):
     """For any give CCompiler instance, this gives us the name of C compiler
     (the actual executable).
-    
+
     NOTE: does NOT work with FCompiler instances."""
     # Geez, why does distutils has no common way to get the compiler name...
     if compiler.compiler_type == 'msvc':
@@ -112,7 +112,7 @@
         # hardcoded string
         #compiler.initialize()
         #print compiler.cc
-        return 'cl.exe' 
+        return 'cl.exe'
     else:
         return compiler.compiler[0]
 
@@ -124,7 +124,7 @@
 def get_cxxcompiler_executable(compiler):
     """For any give CCompiler instance, this gives us the name of CXX compiler
     (the actual executable).
-    
+
     NOTE: does NOT work with FCompiler instances."""
     # Geez, why does distutils has no common way to get the compiler name...
     if compiler.compiler_type == 'msvc':
@@ -135,7 +135,7 @@
         # hardcoded string
         #compiler.initialize()
         #print compiler.cc
-        return 'cl.exe' 
+        return 'cl.exe'
     else:
         return compiler.compiler_cxx[0]
 
@@ -181,7 +181,7 @@
     # XXX: add an option to the scons command for configuration (auto/force/cache).
     description = "Scons builder"
     user_options = old_build_ext.user_options + \
-            [('jobs=', None, 
+            [('jobs=', None,
               "specify number of worker threads when executing scons"),
              ('scons-tool-path=', None, 'specify additional path '\
                                     '(absolute) to look for scons tools'),
@@ -239,11 +239,11 @@
             self.scons_compiler = dist2sconscc(distutils_compiler)
             self.scons_compiler_path = protect_path(get_tool_path(distutils_compiler))
         except DistutilsPlatformError, e:
-            if not self._bypass_distutils_cc: 
+            if not self._bypass_distutils_cc:
                 raise e
             else:
                 self.scons_compiler = compiler_type
- 		
+
         # We do the same for the fortran compiler ...
         fcompiler_type = self.fcompiler
         from numpy.distutils.fcompiler import new_fcompiler

Modified: trunk/numpy/distutils/misc_util.py
===================================================================
--- trunk/numpy/distutils/misc_util.py	2008-02-08 10:17:57 UTC (rev 4774)
+++ trunk/numpy/distutils/misc_util.py	2008-02-08 10:54:01 UTC (rev 4775)
@@ -1192,8 +1192,8 @@
             full_source_files.extend([self.paths(i)[0] for i in source_files])
 
         if dist is not None:
-            dist.scons_data.append((fullsconsname, 
-                                    pre_hook, 
+            dist.scons_data.append((fullsconsname,
+                                    pre_hook,
                                     post_hook,
                                     full_source_files,
                                     parent_name))
@@ -1203,8 +1203,8 @@
             # options in distutils command.
             dist.add_extension('', sources = [])
         else:
-            self.scons_data.append((fullsconsname, 
-                                    pre_hook, 
+            self.scons_data.append((fullsconsname,
+                                    pre_hook,
                                     post_hook,
                                     full_source_files,
                                     parent_name))
@@ -1214,7 +1214,7 @@
 
     def add_configres(self):
         from numscons import get_scons_configres_dir, get_scons_configres_filename
-        file = os.path.join(get_scons_configres_dir(), self.local_path, 
+        file = os.path.join(get_scons_configres_dir(), self.local_path,
                             get_scons_configres_filename())
 
     def add_scripts(self,*files):

Modified: trunk/numpy/doc/example.py
===================================================================
--- trunk/numpy/doc/example.py	2008-02-08 10:17:57 UTC (rev 4774)
+++ trunk/numpy/doc/example.py	2008-02-08 10:54:01 UTC (rev 4775)
@@ -53,7 +53,7 @@
         Explanation
 
     See Also
-    --------    
+    --------
     otherfunc : relationship (optional)
     newfunc : relationship (optional)
 

Modified: trunk/numpy/fft/setupscons.py
===================================================================
--- trunk/numpy/fft/setupscons.py	2008-02-08 10:17:57 UTC (rev 4774)
+++ trunk/numpy/fft/setupscons.py	2008-02-08 10:54:01 UTC (rev 4775)
@@ -4,7 +4,7 @@
 
     config.add_data_dir('tests')
 
-    config.add_sconscript('SConstruct', 
+    config.add_sconscript('SConstruct',
                           source_files = ['fftpack_litemodule.c', 'fftpack.c',
                                           'fftpack.h'])
 

Modified: trunk/numpy/lib/arraysetops.py
===================================================================
--- trunk/numpy/lib/arraysetops.py	2008-02-08 10:17:57 UTC (rev 4774)
+++ trunk/numpy/lib/arraysetops.py	2008-02-08 10:54:01 UTC (rev 4775)
@@ -207,7 +207,7 @@
     b1 = nm.zeros( ar1.shape, dtype = nm.int8 )
     b2 = nm.ones( ar2.shape, dtype = nm.int8 )
     tt = nm.concatenate( (b1, b2) )
-        
+
     # We need this to be a stable sort, so always use 'mergesort' here. The
     # values from the first array should always come before the values from the
     # second array.

Modified: trunk/numpy/lib/format.py
===================================================================
--- trunk/numpy/lib/format.py	2008-02-08 10:17:57 UTC (rev 4774)
+++ trunk/numpy/lib/format.py	2008-02-08 10:54:01 UTC (rev 4775)
@@ -227,7 +227,7 @@
         raise ValueError("Header does not contain the correct keys: %r" % (keys,))
 
     # Sanity-check the values.
-    if (not isinstance(d['shape'], tuple) or 
+    if (not isinstance(d['shape'], tuple) or
         not numpy.all([isinstance(x, int) for x in d['shape']])):
         raise ValueError("shape is not valid: %r" % (d['shape'],))
     if not isinstance(d['fortran_order'], bool):
@@ -407,6 +407,3 @@
         mode=mode, offset=offset)
 
     return marray
-
-
-

Modified: trunk/numpy/lib/io.py
===================================================================
--- trunk/numpy/lib/io.py	2008-02-08 10:17:57 UTC (rev 4774)
+++ trunk/numpy/lib/io.py	2008-02-08 10:54:01 UTC (rev 4775)
@@ -19,8 +19,8 @@
 _file = file
 
 class BagObj(object):
-    """A simple class that converts attribute lookups to 
-    getitems on the class passed in. 
+    """A simple class that converts attribute lookups to
+    getitems on the class passed in.
     """
     def __init__(self, obj):
         self._obj = obj
@@ -31,8 +31,8 @@
             raise AttributeError, key
 
 class NpzFile(object):
-    """A dictionary-like object with lazy-loading of files in the zipped 
-    archive provided on construction. 
+    """A dictionary-like object with lazy-loading of files in the zipped
+    archive provided on construction.
 
     The arrays and file strings are lazily loaded on either
     getitem access using obj['key'] or attribute lookup using obj.f.key
@@ -54,13 +54,13 @@
 
     def __getitem__(self, key):
         # FIXME: This seems like it will copy strings around
-        #   more than is strictly necessary.  The zipfile 
+        #   more than is strictly necessary.  The zipfile
         #   will read the string and then
         #   the format.read_array will copy the string
-        #   to another place in memory. 
-        #   It would be better if the zipfile could read 
+        #   to another place in memory.
+        #   It would be better if the zipfile could read
         #   (or at least uncompress) the data
-        #   directly into the array memory. 
+        #   directly into the array memory.
         member = 0
         if key in self._files:
             member = 1
@@ -90,21 +90,21 @@
     memmap : bool
         If true, then memory-map the .npy file or unzip the .npz file into
            a temporary directory and memory-map each component
-        This has no effect for a pickle. 
+        This has no effect for a pickle.
 
     Returns
     -------
     result : array, tuple, dict, etc.
-        data stored in the file. 
+        data stored in the file.
         If file contains pickle data, then whatever is stored in the pickle is
           returned.
-        If the file is .npy file, then an array is returned.  
-        If the file is .npz file, then a dictionary-like object is returned 
+        If the file is .npy file, then an array is returned.
+        If the file is .npz file, then a dictionary-like object is returned
           which has a filename:array key:value pair for every file in the zip.
 
     Raises
     ------
-    IOError 
+    IOError
     """
     if isinstance(file, type("")):
         fid = _file(file,"rb")
@@ -124,7 +124,7 @@
     elif magic == format.MAGIC_PREFIX: # .npy file
         return format.read_array(fid)
     else:  # Try a pickle
-        try: 
+        try:
             return _cload(fid)
         except:
             raise IOError, \
@@ -133,8 +133,8 @@
 def save(file, arr):
     """Save an array to a binary file (a string or file-like object).
 
-    If the file is a string, then if it does not have the .npy extension, 
-        it is appended and a file open. 
+    If the file is a string, then if it does not have the .npy extension,
+        it is appended and a file open.
 
     Data is saved to the open file in NumPy-array format
 
@@ -144,7 +144,7 @@
     ...
     np.save('myfile', a)
     a = np.load('myfile.npy')
-    """    
+    """
     if isinstance(file, str):
         if not file.endswith('.npy'):
             file = file + '.npy'
@@ -158,15 +158,15 @@
 def savez(file, *args, **kwds):
     """Save several arrays into an .npz file format which is a zipped-archive
     of arrays
-    
-    If keyword arguments are given, then filenames are taken from the keywords. 
-    If arguments are passed in with no keywords, then stored file names are 
-    arr_0, arr_1, etc.  
+
+    If keyword arguments are given, then filenames are taken from the keywords.
+    If arguments are passed in with no keywords, then stored file names are
+    arr_0, arr_1, etc.
     """
 
     if isinstance(file, str):
         if not file.endswith('.npz'):
-            file = file + '.npz'        
+            file = file + '.npz'
 
     namedict = kwds
     for i, val in enumerate(args):
@@ -190,7 +190,7 @@
         format.write_array(fid, np.asanyarray(val))
         fid.close()
         zip.write(filename, arcname=fname)
-        
+
     zip.close()
     for name in todel:
         os.remove(name)
@@ -359,7 +359,3 @@
 
     if origShape is not None:
         X.shape = origShape
-
-
-
-

Modified: trunk/numpy/lib/scimath.py
===================================================================
--- trunk/numpy/lib/scimath.py	2008-02-08 10:17:57 UTC (rev 4774)
+++ trunk/numpy/lib/scimath.py	2008-02-08 10:54:01 UTC (rev 4775)
@@ -93,7 +93,7 @@
     """Convert `x` to complex if it has real, negative components.
 
     Otherwise, output is just the array version of the input (via asarray).
-    
+
     Parameters
     ----------
     x : array_like
@@ -119,7 +119,7 @@
     """Convert `x` to double if it has real, negative components.
 
     Otherwise, output is just the array version of the input (via asarray).
-    
+
     Parameters
     ----------
     x : array_like
@@ -145,7 +145,7 @@
     """Convert `x` to complex if it has real components x_i with abs(x_i)>1.
 
     Otherwise, output is just the array version of the input (via asarray).
-    
+
     Parameters
     ----------
     x : array_like
@@ -203,7 +203,7 @@
 
     If x contains negative inputs, the answer is computed and returned in the
     complex domain.
-    
+
     Parameters
     ----------
     x : array_like
@@ -221,7 +221,7 @@
 
     Negative arguments are correctly handled (recall that for negative
     arguments, the identity exp(log(z))==z does not hold anymore):
-    
+
     >>> log(-math.exp(1)) == (1+1j*math.pi)
     True
     """
@@ -233,7 +233,7 @@
 
     If x contains negative inputs, the answer is computed and returned in the
     complex domain.
-    
+
     Parameters
     ----------
     x : array_like
@@ -263,7 +263,7 @@
 
     If x contains negative inputs, the answer is computed and returned in the
     complex domain.
-    
+
     Parameters
     ----------
     x : array_like
@@ -293,7 +293,7 @@
 
     If x contains negative inputs, the answer is computed and returned in the
     complex domain.
-    
+
     Parameters
     ----------
     x : array_like
@@ -307,7 +307,7 @@
 
     (We set the printing precision so the example can be auto-tested)
     >>> import numpy as np; np.set_printoptions(precision=4)
-    
+
     >>> log2([4,8])
     array([ 2.,  3.])
 
@@ -323,7 +323,7 @@
     If x contains negative values, it is converted to the complex domain.
 
     If p contains negative values, it is converted to floating point.
-    
+
     Parameters
     ----------
     x : array_like
@@ -332,7 +332,7 @@
     Returns
     -------
     array_like
-    
+
     Examples
     --------
     (We set the printing precision so the example can be auto-tested)
@@ -357,7 +357,7 @@
     For real x with abs(x)<=1, this returns the principal value.
 
     If abs(x)>1, the complex arccos() is computed.
-    
+
     Parameters
     ----------
     x : array_like
@@ -385,7 +385,7 @@
     For real x with abs(x)<=1, this returns the principal value.
 
     If abs(x)>1, the complex arcsin() is computed.
-    
+
     Parameters
     ----------
     x : array_like
@@ -414,7 +414,7 @@
     For real x with abs(x)<=1, this returns the principal value.
 
     If abs(x)>1, the complex arctanh() is computed.
-    
+
     Parameters
     ----------
     x : array_like

Modified: trunk/numpy/lib/setupscons.py
===================================================================
--- trunk/numpy/lib/setupscons.py	2008-02-08 10:17:57 UTC (rev 4774)
+++ trunk/numpy/lib/setupscons.py	2008-02-08 10:54:01 UTC (rev 4775)
@@ -5,7 +5,7 @@
 
     config = Configuration('lib',parent_package,top_path)
 
-    config.add_sconscript('SConstruct', 
+    config.add_sconscript('SConstruct',
                           source_files = [join('src', '_compiled_base.c')])
     config.add_data_dir('tests')
 

Modified: trunk/numpy/lib/tests/test_format.py
===================================================================
--- trunk/numpy/lib/tests/test_format.py	2008-02-08 10:17:57 UTC (rev 4774)
+++ trunk/numpy/lib/tests/test_format.py	2008-02-08 10:54:01 UTC (rev 4775)
@@ -21,9 +21,9 @@
     ...     np.complex128,
     ...     object,
     ... ]
-    >>> 
+    >>>
     >>> basic_arrays = []
-    >>> 
+    >>>
     >>> for scalar in scalars:
     ...     for endian in '<>':
     ...         dtype = np.dtype(scalar).newbyteorder(endian)
@@ -36,20 +36,20 @@
     ...             basic.reshape((3,5)).T,
     ...             basic.reshape((3,5))[::-1,::2],
     ...         ])
-    ... 
-    >>> 
+    ...
+    >>>
     >>> Pdescr = [
     ...     ('x', 'i4', (2,)),
     ...     ('y', 'f8', (2, 2)),
     ...     ('z', 'u1')]
-    >>> 
-    >>> 
+    >>>
+    >>>
     >>> PbufferT = [
     ...     ([3,2], [[6.,4.],[6.,4.]], 8),
     ...     ([4,3], [[7.,5.],[7.,5.]], 9),
     ...     ]
-    >>> 
-    >>> 
+    >>>
+    >>>
     >>> Ndescr = [
     ...     ('x', 'i4', (2,)),
     ...     ('Info', [
@@ -68,14 +68,14 @@
     ...         ('Value', 'c16')]),
     ...     ('y', 'f8', (2, 2)),
     ...     ('z', 'u1')]
-    >>> 
-    >>> 
+    >>>
+    >>>
     >>> NbufferT = [
     ...     ([3,2], (6j, 6., ('nn', [6j,4j], [6.,4.], [1,2]), 'NN', True), 'cc', ('NN', 6j), [[6.,4.],[6.,4.]], 8),
     ...     ([4,3], (7j, 7., ('oo', [7j,5j], [7.,5.], [2,1]), 'OO', False), 'dd', ('OO', 7j), [[7.,5.],[7.,5.]], 9),
     ...     ]
-    >>> 
-    >>> 
+    >>>
+    >>>
     >>> record_arrays = [
     ...     np.array(PbufferT, dtype=np.dtype(Pdescr).newbyteorder('<')),
     ...     np.array(NbufferT, dtype=np.dtype(Ndescr).newbyteorder('<')),
@@ -111,7 +111,7 @@
     ...     f = StringIO()
     ...     format.write_array_header_1_0(f, arr)
     ...     print repr(f.getvalue())
-    ... 
+    ...
     "F\x00{'descr': '|u1', 'fortran_order': False, 'shape': (0,)}              \n"
     "F\x00{'descr': '|u1', 'fortran_order': False, 'shape': ()}                \n"
     "F\x00{'descr': '|u1', 'fortran_order': False, 'shape': (15,)}             \n"
@@ -506,5 +506,3 @@
     for magic in bad_version_magic + malformed_magic:
         f = StringIO(magic)
         yield raises(ValueError)(format.read_array), f
-
-

Modified: trunk/numpy/lib/utils.py
===================================================================
--- trunk/numpy/lib/utils.py	2008-02-08 10:17:57 UTC (rev 4774)
+++ trunk/numpy/lib/utils.py	2008-02-08 10:54:01 UTC (rev 4775)
@@ -106,7 +106,7 @@
     else:
         str1 = "%s is deprecated, use %s" % (oldname, newname),
         depdoc = '%s is DEPRECATED!! -- use %s instead' % (oldname, newname,)
-        
+
     def newfunc(*args,**kwds):
         warnings.warn(str1, DeprecationWarning)
         return func(*args, **kwds)
@@ -487,28 +487,28 @@
 #   * raise SyntaxError instead of a custom exception.
 
 class SafeEval(object):
-    
+
     def visit(self, node, **kw):
         cls = node.__class__
         meth = getattr(self,'visit'+cls.__name__,self.default)
         return meth(node, **kw)
-            
+
     def default(self, node, **kw):
         raise SyntaxError("Unsupported source construct: %s" % node.__class__)
-            
+
     def visitExpression(self, node, **kw):
         for child in node.getChildNodes():
             return self.visit(child, **kw)
-    
+
     def visitConst(self, node, **kw):
         return node.value
 
     def visitDict(self, node,**kw):
         return dict([(self.visit(k),self.visit(v)) for k,v in node.items])
-        
+
     def visitTuple(self, node, **kw):
         return tuple([self.visit(i) for i in node.nodes])
-        
+
     def visitList(self, node, **kw):
         return [self.visit(i) for i in node.nodes]
 
@@ -578,5 +578,3 @@
         raise
 
 #-----------------------------------------------------------------------------
-
-

Modified: trunk/numpy/linalg/linalg.py
===================================================================
--- trunk/numpy/linalg/linalg.py	2008-02-08 10:17:57 UTC (rev 4774)
+++ trunk/numpy/linalg/linalg.py	2008-02-08 10:54:01 UTC (rev 4775)
@@ -138,11 +138,11 @@
 
 def tensorsolve(a, b, axes=None):
     """Solve the tensor equation a x = b for x
-    
+
     It is assumed that all indices of x are summed over in the product,
     together with the rightmost indices of a, similarly as in
     tensordot(a, x, axes=len(b.shape)).
-    
+
     Parameters
     ----------
     a : array, shape b.shape+Q
@@ -153,11 +153,11 @@
     axes : tuple of integers
         Axes in a to reorder to the right, before inversion.
         If None (default), no reordering is done.
-    
+
     Returns
     -------
     x : array, shape Q
-    
+
     Examples
     --------
     >>> from numpy import *
@@ -169,7 +169,7 @@
     (2, 3, 4)
     >>> allclose(tensordot(a, x, axes=3), b)
     True
-    
+
     """
     a = asarray(a)
     b = asarray(b)
@@ -206,7 +206,7 @@
     x : array, shape (M,)
 
     Raises LinAlgError if a is singular or not square
-    
+
     """
     one_eq = len(b.shape) == 1
     if one_eq:
@@ -239,10 +239,10 @@
 
     The result is an inverse corresponding to the operation
     tensordot(a, b, ind), ie.,
-    
+
         x == tensordot(tensordot(tensorinv(a), a, ind), x, ind)
           == tensordot(tensordot(a, tensorinv(a), ind), x, ind)
-    
+
     for all x (up to floating-point accuracy).
 
     Parameters
@@ -298,12 +298,12 @@
 
 def inv(a):
     """Compute the inverse of a matrix.
-    
+
     Parameters
     ----------
     a : array-like, shape (M, M)
         Matrix to be inverted
-    
+
     Returns
     -------
     ainv : array-like, shape (M, M)
@@ -330,20 +330,20 @@
 
 def cholesky(a):
     """Compute the Cholesky decomposition of a matrix.
-    
+
     Returns the Cholesky decomposition, :lm:`A = L L^*` of a Hermitian
     positive-definite matrix :lm:`A`.
-    
+
     Parameters
     ----------
     a : array, shape (M, M)
         Matrix to be decomposed
-    
+
     Returns
     -------
     L : array, shape (M, M)
         Lower-triangular Cholesky factor of A
-    
+
     Raises LinAlgError if decomposition fails
 
     Examples
@@ -357,7 +357,7 @@
     >>> dot(L, L.T.conj())
     array([[ 1.+0.j,  0.-2.j],
            [ 0.+2.j,  5.+0.j]])
-    
+
     """
     _assertRank2(a)
     _assertSquareness(a)
@@ -400,7 +400,7 @@
     Q : double or complex array, shape (M, K)
     R : double or complex array, shape (K, N)
         Size K = min(M, N)
-    
+
     mode = 'r'
     R : double or complex array, shape (K, N)
 
@@ -429,7 +429,7 @@
     True
     >>> allclose(r, triu(r3[:6,:6], k=0))
     True
-    
+
     """
     _assertRank2(a)
     m, n = a.shape
@@ -507,7 +507,7 @@
 
 def eigvals(a):
     """Compute the eigenvalues of a general matrix.
-    
+
     Parameters
     ----------
     a : array, shape (M, M)
@@ -520,7 +520,7 @@
         The eigenvalues, each repeated according to its multiplicity.
         They are not necessarily ordered, nor are they necessarily
         real for real matrices.
-    
+
     Raises LinAlgError if eigenvalue computation does not converge
 
     See Also
@@ -534,7 +534,7 @@
     This is a simple interface to the LAPACK routines dgeev and zgeev
     that sets the flags to return only the eigenvalues of general real
     and complex arrays respectively.
-    
+
     The number w is an eigenvalue of a if there exists a vector v
     satisfying the equation dot(a,v) = w*v. Alternately, if w is a root of
     the characteristic equation det(a - w[i]*I) = 0, where det is the
@@ -586,7 +586,7 @@
 
 def eigvalsh(a, UPLO='L'):
     """Compute the eigenvalues of a Hermitean or real symmetric matrix.
-    
+
     Parameters
     ----------
     a : array, shape (M, M)
@@ -596,7 +596,7 @@
         Specifies whether the pertinent array data is taken from the upper
         or lower triangular part of a. Possible values are 'L', and 'U' for
         upper and lower respectively. Default is 'L'.
-    
+
     Returns
     -------
     w : double array, shape (M,)
@@ -616,7 +616,7 @@
     This is a simple interface to the LAPACK routines dsyevd and
     zheevd that sets the flags to return only the eigenvalues of real
     symmetric and complex Hermetian arrays respectively.
-    
+
     The number w is an eigenvalue of a if there exists a vector v
     satisfying the equation dot(a,v) = w*v. Alternately, if w is a root of
     the characteristic equation det(a - w[i]*I) = 0, where det is the
@@ -714,10 +714,10 @@
     that fact. If the eigenvalues are all different, then theoretically the
     eigenvectors are independent. Likewise, the matrix of eigenvectors is
     unitary if the matrix a is normal, i.e., if dot(a, a.H) = dot(a.H, a).
-    
+
     The left and right eigenvectors are not necessarily the (Hermitian)
     transposes of each other.
-    
+
     """
     a, wrap = _makearray(a)
     _assertRank2(a)
@@ -775,7 +775,7 @@
 
 def eigh(a, UPLO='L'):
     """Compute eigenvalues for a Hermitian or real symmetric matrix.
-    
+
     Parameters
     ----------
     a : array, shape (M, M)
@@ -785,7 +785,7 @@
         Specifies whether the pertinent array date is taken from the upper
         or lower triangular part of a. Possible values are 'L', and 'U'.
         Default is 'L'.
-    
+
     Returns
     -------
     w : double array, shape (M,)
@@ -793,7 +793,7 @@
     v : double or complex double array, shape (M, M)
         The normalized eigenvector corresponding to the eigenvalue w[i] is
         the column v[:,i].
-    
+
     Raises LinAlgError if eigenvalue computation does not converge
 
     See Also
@@ -801,13 +801,13 @@
     eigvalsh : eigenvalues of symmetric or Hemitiean arrays.
     eig : eigenvalues and right eigenvectors for non-symmetric arrays
     eigvals : eigenvalues of non-symmetric array.
-    
+
     Notes
     -----
     A simple interface to the LAPACK routines dsyevd and zheevd that compute
     the eigenvalues and eigenvectors of real symmetric and complex Hermitian
     arrays respectively.
-    
+
     The number w is an eigenvalue of a if there exists a vector v
     satisfying the equation dot(a,v) = w*v. Alternately, if w is a root of
     the characteristic equation det(a - w[i]*I) = 0, where det is the
@@ -866,7 +866,7 @@
     an 1d-array s of singular values (real, non-negative) such that
     a == U S Vh  if S is an suitably shaped matrix of zeros whose
     main diagonal is s.
-    
+
     Parameters
     ----------
     a : array, shape (M, N)
@@ -876,7 +876,7 @@
         If false, the shapes are    (M,K), (K,N) where K = min(M,N)
     compute_uv : boolean
         Whether to compute also U, Vh in addition to s
-    
+
     Returns
     -------
     U:  array, shape (M,M) or (M,K) depending on full_matrices
@@ -884,7 +884,7 @@
         The singular values, sorted so that s[i] >= s[i+1]
         K = min(M, N)
     Vh: array, shape (N,N) or (K,N) depending on full_matrices
-    
+
     For compute_uv = False, only s is returned.
 
     Raises LinAlgError if SVD computation does not converge
@@ -895,14 +895,14 @@
     >>> U, s, Vh = linalg.svd(a)
     >>> U.shape, Vh.shape, s.shape
     ((9, 9), (6, 6), (6,))
-    
+
     >>> U, s, Vh = linalg.svd(a, full_matrices=False)
     >>> U.shape, Vh.shape, s.shape
     ((9, 6), (6, 6), (6,))
     >>> S = diag(s)
     >>> allclose(a, dot(U, dot(S, Vh)))
     True
-    
+
     >>> s2 = linalg.svd(a, compute_uv=False)
     >>> allclose(s, s2)
     True
@@ -969,11 +969,11 @@
 
 def pinv(a, rcond=1e-15 ):
     """Compute the (Moore-Penrose) pseudo-inverse of a matrix.
-    
+
     Calculate a generalized inverse of a matrix using its
     singular-value decomposition and including all 'large' singular
     values.
-    
+
     Parameters
     ----------
     a : array, shape (M, N)
@@ -982,11 +982,11 @@
         Cutoff for 'small' singular values.
         Singular values smaller than rcond*largest_singular_value are
         considered zero.
-    
+
     Returns
     -------
     B : array, shape (N, M)
-    
+
     Raises LinAlgError if SVD computation does not converge
 
     Examples
@@ -998,7 +998,7 @@
     True
     >>> allclose(B, dot(B, dot(a, B)))
     True
-    
+
     """
     a, wrap = _makearray(a)
     _assertNonEmpty(a)
@@ -1028,7 +1028,7 @@
     -------
     det : float or complex
         Determinant of a
-    
+
     Notes
     -----
     The determinant is computed via LU factorization, LAPACK routine z/dgetrf.
@@ -1057,9 +1057,9 @@
 
 def lstsq(a, b, rcond=-1):
     """Compute least-squares solution to equation :m:`a x = b`
-    
+
     Compute a vector x such that the 2-norm :m:`|b - a x|` is minimised.
-    
+
     Parameters
     ----------
     a : array, shape (M, N)
@@ -1068,9 +1068,9 @@
         Cutoff for 'small' singular values.
         Singular values smaller than rcond*largest_singular_value are
         considered zero.
-    
+
     Raises LinAlgError if computation does not converge
-    
+
     Returns
     -------
     x : array, shape (N,) or (N, K) depending on shape of b
@@ -1169,7 +1169,7 @@
         -2     smallest singular value       as below
         other  -                             sum(abs(x)**ord)**(1./ord)
         =====  ============================  ==========================
-    
+
     Returns
     -------
     n : float
@@ -1180,7 +1180,7 @@
     For values ord < 0, the result is, strictly speaking, not a
     mathematical 'norm', but it may still be useful for numerical
     purposes.
-    
+
     """
     x = asarray(x)
     nd = len(x.shape)

Modified: trunk/numpy/linalg/setupscons.py
===================================================================
--- trunk/numpy/linalg/setupscons.py	2008-02-08 10:17:57 UTC (rev 4774)
+++ trunk/numpy/linalg/setupscons.py	2008-02-08 10:54:01 UTC (rev 4775)
@@ -6,7 +6,7 @@
 
     config.add_data_dir('tests')
 
-    config.add_sconscript('SConstruct', 
+    config.add_sconscript('SConstruct',
                           source_files = ['lapack_litemodule.c',
                                           'zlapack_lite.c', 'dlapack_lite.c',
                                           'blas_lite.c', 'dlamch.c',

Modified: trunk/numpy/random/setupscons.py
===================================================================
--- trunk/numpy/random/setupscons.py	2008-02-08 10:17:57 UTC (rev 4774)
+++ trunk/numpy/random/setupscons.py	2008-02-08 10:54:01 UTC (rev 4775)
@@ -5,12 +5,12 @@
     from numpy.distutils.misc_util import Configuration, get_mathlibs
     config = Configuration('random',parent_package,top_path)
 
-    source_files = [join('mtrand', i) for i in ['mtrand.c', 
+    source_files = [join('mtrand', i) for i in ['mtrand.c',
                                                 'mtrand.pyx',
                                                 'numpy.pxi',
-                                                'randomkit.c', 
-                                                'randomkit.h', 
-                                                'Python.pxi', 
+                                                'randomkit.c',
+                                                'randomkit.h',
+                                                'Python.pxi',
                                                 'initarray.c',
                                                 'initarray.h',
                                                 'distributions.c',



More information about the Numpy-svn mailing list