[Scipy-svn] r5179 - in trunk: doc doc/frontpage scipy/cluster scipy/linalg scipy/linalg/tests scipy/sparse scipy/sparse/linalg scipy/sparse/linalg/eigen/arpack scipy/sparse/linalg/eigen/arpack/tests scipy/sparse/linalg/tests scipy/sparse/tests scipy/stats scipy/stats/tests

scipy-svn@scip... scipy-svn@scip...
Mon Nov 24 02:18:32 CST 2008


Author: jarrod.millman
Date: 2008-11-24 02:18:25 -0600 (Mon, 24 Nov 2008)
New Revision: 5179

Modified:
   trunk/doc/frontpage/conf.py
   trunk/doc/postprocess.py
   trunk/scipy/cluster/hierarchy.py
   trunk/scipy/linalg/decomp.py
   trunk/scipy/linalg/tests/test_decomp.py
   trunk/scipy/sparse/base.py
   trunk/scipy/sparse/linalg/eigen/arpack/setup.py
   trunk/scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py
   trunk/scipy/sparse/linalg/interface.py
   trunk/scipy/sparse/linalg/tests/test_interface.py
   trunk/scipy/sparse/tests/test_base.py
   trunk/scipy/stats/stats.py
   trunk/scipy/stats/tests/test_discrete_basic.py
Log:
ran reindent before tagging later tonight


Modified: trunk/doc/frontpage/conf.py
===================================================================
--- trunk/doc/frontpage/conf.py	2008-11-24 07:44:09 UTC (rev 5178)
+++ trunk/doc/frontpage/conf.py	2008-11-24 08:18:25 UTC (rev 5179)
@@ -168,7 +168,7 @@
 
 # Grouping the document tree into LaTeX files. List of tuples
 # (source start file, target name, title, author, document class [howto/manual]).
-latex_documents = [ ] 
+latex_documents = [ ]
 
 # The name of an image file (relative to this directory) to place at the top of
 # the title page.

Modified: trunk/doc/postprocess.py
===================================================================
--- trunk/doc/postprocess.py	2008-11-24 07:44:09 UTC (rev 5178)
+++ trunk/doc/postprocess.py	2008-11-24 08:18:25 UTC (rev 5179)
@@ -40,7 +40,7 @@
 def process_tex(lines):
     """
     Remove unnecessary section titles from the LaTeX file.
-    
+
     """
     new_lines = []
     for line in lines:

Modified: trunk/scipy/cluster/hierarchy.py
===================================================================
--- trunk/scipy/cluster/hierarchy.py	2008-11-24 07:44:09 UTC (rev 5178)
+++ trunk/scipy/cluster/hierarchy.py	2008-11-24 08:18:25 UTC (rev 5179)
@@ -973,9 +973,9 @@
            deviation of the link heights, respectively; ``R[i,2]`` is
            the number of links included in the calculation; and
            ``R[i,3]`` is the inconsistency coefficient,
-           
+
            .. math::
-           
+
                \frac{\mathtt{Z[i,2]}-\mathtt{R[i,0]}}
                     {R[i,1]}.
     """

Modified: trunk/scipy/linalg/decomp.py
===================================================================
--- trunk/scipy/linalg/decomp.py	2008-11-24 07:44:09 UTC (rev 5178)
+++ trunk/scipy/linalg/decomp.py	2008-11-24 08:18:25 UTC (rev 5179)
@@ -207,7 +207,7 @@
 def eigh(a, b=None, lower=True, eigvals_only=False, overwrite_a=False,
          overwrite_b=False, turbo=True, eigvals=None, type=1):
     """Solve an ordinary or generalized eigenvalue problem for a complex
-    Hermitian or real symmetric matrix. 
+    Hermitian or real symmetric matrix.
 
     Find eigenvalues w and optionally eigenvectors v of matrix a, where
     b is positive definite::
@@ -262,8 +262,8 @@
         type 2:        inv(v).conj() a  inv(v) = w
         type = 1 or 2:      v.conj() b      v  = I
         type = 3     :      v.conj() inv(b) v  = I
-        
-    Raises LinAlgError if eigenvalue computation does not converge, 
+
+    Raises LinAlgError if eigenvalue computation does not converge,
     an error occurred, or b matrix is not definite positive. Note that
     if input matrices are not symmetric or hermitian, no error is reported
     but results will be wrong.
@@ -296,7 +296,7 @@
             cplx = cplx or False
     else:
         b1 = None
-        
+
     # Set job for fortran routines
     _job = (eigvals_only and 'N') or 'V'
 
@@ -321,17 +321,17 @@
         pfx = 'he'
     else:
         pfx = 'sy'
-        
+
     #  Standard Eigenvalue Problem
     #  Use '*evr' routines
     # FIXME: implement calculation of optimal lwork
     #        for all lapack routines
     if b1 is None:
         (evr,) = get_lapack_funcs((pfx+'evr',), (a1,))
-	if eigvals is None:
+        if eigvals is None:
             w, v, info = evr(a1, uplo=uplo, jobz=_job, range="A", il=1,
                              iu=a1.shape[0], overwrite_a=overwrite_a)
-        else: 
+        else:
             (lo, hi)= eigvals
             w_tot, v, info = evr(a1, uplo=uplo, jobz=_job, range="I",
                                  il=lo, iu=hi, overwrite_a=overwrite_a)
@@ -367,7 +367,7 @@
             return w
         else:
             return w, v
-        
+
     elif info < 0:
         raise LinAlgError("illegal value in %i-th argument of internal"
                           " fortran routine." % (-info))
@@ -579,7 +579,7 @@
 def eigvalsh(a, b=None, lower=True, overwrite_a=False,
              overwrite_b=False, turbo=True, eigvals=None, type=1):
     """Solve an ordinary or generalized eigenvalue problem for a complex
-    Hermitian or real symmetric matrix. 
+    Hermitian or real symmetric matrix.
 
     Find eigenvalues w of matrix a, where b is positive definite::
 
@@ -622,7 +622,7 @@
         The N (1<=N<=M) selected eigenvalues, in ascending order, each
         repeated according to its multiplicity.
 
-    Raises LinAlgError if eigenvalue computation does not converge, 
+    Raises LinAlgError if eigenvalue computation does not converge,
     an error occurred, or b matrix is not definite positive. Note that
     if input matrices are not symmetric or hermitian, no error is reported
     but results will be wrong.
@@ -636,7 +636,7 @@
     """
     return eigh(a, b=b, lower=lower, eigvals_only=True,
                 overwrite_a=overwrite_a, overwrite_b=overwrite_b,
-                turbo=turbo, eigvals=eigvals, type=type) 
+                turbo=turbo, eigvals=eigvals, type=type)
 
 def eigvals_banded(a_band,lower=0,overwrite_a_band=0,
                    select='a', select_range=None):

Modified: trunk/scipy/linalg/tests/test_decomp.py
===================================================================
--- trunk/scipy/linalg/tests/test_decomp.py	2008-11-24 07:44:09 UTC (rev 5178)
+++ trunk/scipy/linalg/tests/test_decomp.py	2008-11-24 08:18:25 UTC (rev 5179)
@@ -515,7 +515,7 @@
     # add antisymmetric matrix as imag part
     a = a1 +1j*(triu(a2)-tril(a2))
     return a.astype(dtype)
-  
+
 def eigenhproblem_standard(desc, dim, dtype,
                            overwrite, lower, turbo,
                            eigvals):
@@ -524,7 +524,7 @@
         a = _complex_symrand(dim, dtype)
     else:
         a = symrand(dim).astype(dtype)
-    
+
     if overwrite:
         a_c = a.copy()
     else:
@@ -559,7 +559,7 @@
     assert_array_almost_equal(diag1_, w, DIGITS[dtype])
     diag2_ = diag(dot(z.T.conj(), dot(b_c, z))).real
     assert_array_almost_equal(diag2_, ones(diag2_.shape[0]), DIGITS[dtype])
-    
+
 def test_eigh_integer():
     a = array([[1,2],[2,7]])
     b = array([[3,1],[1,5]])

Modified: trunk/scipy/sparse/base.py
===================================================================
--- trunk/scipy/sparse/base.py	2008-11-24 07:44:09 UTC (rev 5178)
+++ trunk/scipy/sparse/base.py	2008-11-24 08:18:25 UTC (rev 5179)
@@ -292,7 +292,7 @@
             other = np.asanyarray(other)
 
         other = np.asanyarray(other)
-    
+
         if other.ndim == 1 or other.ndim == 2 and other.shape[1] == 1:
             # dense row or column vector
             if other.shape != (N,) and other.shape != (N,1):

Modified: trunk/scipy/sparse/linalg/eigen/arpack/setup.py
===================================================================
--- trunk/scipy/sparse/linalg/eigen/arpack/setup.py	2008-11-24 07:44:09 UTC (rev 5178)
+++ trunk/scipy/sparse/linalg/eigen/arpack/setup.py	2008-11-24 08:18:25 UTC (rev 5179)
@@ -3,7 +3,7 @@
 from os.path import join
 
 def needs_veclib_wrapper(info):
-    """Returns true if needs special veclib wrapper.""" 
+    """Returns true if needs special veclib wrapper."""
     import re
     r_accel = re.compile("Accelerate")
     r_vec = re.compile("vecLib")

Modified: trunk/scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py
===================================================================
--- trunk/scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py	2008-11-24 07:44:09 UTC (rev 5178)
+++ trunk/scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py	2008-11-24 08:18:25 UTC (rev 5179)
@@ -261,7 +261,7 @@
         for typ in 'FD':
             for which in ['LI','LR','LM','SI','SR','SM']:
                 for m in self.nonsymmetric:
-                      self.eval_evec(m,typ,k,which)
+                    self.eval_evec(m,typ,k,which)
 
 if __name__ == "__main__":
     run_module_suite()

Modified: trunk/scipy/sparse/linalg/interface.py
===================================================================
--- trunk/scipy/sparse/linalg/interface.py	2008-11-24 07:44:09 UTC (rev 5178)
+++ trunk/scipy/sparse/linalg/interface.py	2008-11-24 08:18:25 UTC (rev 5179)
@@ -85,14 +85,14 @@
         """Default matrix-matrix multiplication handler.  Falls back on
         the user-defined matvec() routine, which is always provided.
         """
-        
+
         return np.hstack( [ self.matvec(col.reshape(-1,1)) for col in X.T ] )
 
 
     def matvec(self, x):
         """Matrix-vector multiplication
 
-        Performs the operation y=A*x where A is an MxN linear 
+        Performs the operation y=A*x where A is an MxN linear
         operator and x is a column vector or rank-1 array.
 
         Parameters
@@ -103,7 +103,7 @@
         Returns
         -------
         y : {matrix, ndarray}
-            A matrix or ndarray with shape (M,) or (M,1) depending 
+            A matrix or ndarray with shape (M,) or (M,1) depending
             on the type and shape of the x argument.
 
         Notes
@@ -114,14 +114,14 @@
         """
 
         x = np.asanyarray(x)
-        
+
         M,N = self.shape
-            
+
         if x.shape != (N,) and x.shape != (N,1):
             raise ValueError('dimension mismatch')
 
         y = self._matvec(x)
-        
+
         if isinstance(x, np.matrix):
             y = np.asmatrix(y)
         else:
@@ -141,7 +141,7 @@
     def matmat(self, X):
         """Matrix-matrix multiplication
 
-        Performs the operation y=A*X where A is an MxN linear 
+        Performs the operation y=A*X where A is an MxN linear
         operator and X dense N*K matrix or ndarray.
 
         Parameters
@@ -163,10 +163,10 @@
         """
 
         X = np.asanyarray(X)
-        
+
         if X.ndim != 2:
             raise ValueError('expected rank-2 ndarray or matrix')
-        
+
         M,N = self.shape
 
         if X.shape[0] != N:
@@ -178,8 +178,8 @@
             Y = np.asmatrix(Y)
 
         return Y
-        
 
+
     def __mul__(self,x):
         x = np.asarray(x)
 

Modified: trunk/scipy/sparse/linalg/tests/test_interface.py
===================================================================
--- trunk/scipy/sparse/linalg/tests/test_interface.py	2008-11-24 07:44:09 UTC (rev 5178)
+++ trunk/scipy/sparse/linalg/tests/test_interface.py	2008-11-24 08:18:25 UTC (rev 5179)
@@ -4,7 +4,7 @@
 from numpy.testing import *
 
 import numpy as np
-import scipy.sparse as sparse 
+import scipy.sparse as sparse
 
 from scipy.sparse.linalg.interface import *
 
@@ -27,30 +27,30 @@
 
         for matvec in self.matvecs:
             A = LinearOperator((2,3), matvec)
-    
+
             assert_equal(A.matvec(np.array([1,2,3])),       [14,32])
             assert_equal(A.matvec(np.array([[1],[2],[3]])), [[14],[32]])
             assert_equal(A * np.array([1,2,3]),             [14,32])
             assert_equal(A * np.array([[1],[2],[3]]),       [[14],[32]])
-            
+
             assert_equal(A.matvec(np.matrix([[1],[2],[3]])), [[14],[32]])
             assert_equal(A * np.matrix([[1],[2],[3]]),       [[14],[32]])
-    
+
             assert( isinstance(A.matvec(np.array([1,2,3])),       np.ndarray) )
             assert( isinstance(A.matvec(np.array([[1],[2],[3]])), np.ndarray) )
             assert( isinstance(A * np.array([1,2,3]),             np.ndarray) )
             assert( isinstance(A * np.array([[1],[2],[3]]),       np.ndarray) )
-    
+
             assert( isinstance(A.matvec(np.matrix([[1],[2],[3]])), np.ndarray) )
             assert( isinstance(A * np.matrix([[1],[2],[3]]),       np.ndarray) )
-    
+
             assert_raises(ValueError, A.matvec, np.array([1,2]))
             assert_raises(ValueError, A.matvec, np.array([1,2,3,4]))
             assert_raises(ValueError, A.matvec, np.array([[1],[2]]))
             assert_raises(ValueError, A.matvec, np.array([[1],[2],[3],[4]]))
-        
 
 
+
 class TestAsLinearOperator(TestCase):
     def setUp(self):
         self.cases = []
@@ -102,4 +102,3 @@
 
             if hasattr(M,'dtype'):
                 assert_equal(A.dtype, M.dtype)
-

Modified: trunk/scipy/sparse/tests/test_base.py
===================================================================
--- trunk/scipy/sparse/tests/test_base.py	2008-11-24 07:44:09 UTC (rev 5178)
+++ trunk/scipy/sparse/tests/test_base.py	2008-11-24 08:18:25 UTC (rev 5179)
@@ -347,7 +347,7 @@
         assert_array_almost_equal([1,2,3,4]*M, dot([1,2,3,4], M.toarray()))
         row = matrix([[1,2,3,4]])
         assert_array_almost_equal(row*M, row*M.todense())
-    
+
     def test_small_multiplication(self):
         """test that A*x works for x with shape () (1,) and (1,1)
         """

Modified: trunk/scipy/stats/stats.py
===================================================================
--- trunk/scipy/stats/stats.py	2008-11-24 07:44:09 UTC (rev 5178)
+++ trunk/scipy/stats/stats.py	2008-11-24 08:18:25 UTC (rev 5179)
@@ -1034,8 +1034,8 @@
     "mean": is the average score between "weak" and "strict" and is used in
         testing
         see: http://en.wikipedia.org/wiki/Percentile_rank
-    
 
+
     Parameters
     ----------
     a: array like
@@ -1063,13 +1063,13 @@
 
     >>> percentileofscore([1,2,3,4,5,6,7,8,9,10],4) #default kind = 'rank
     40.0
-    >>> percentileofscore([1,2,3,4,5,6,7,8,9,10],4,kind = 'mean') 
+    >>> percentileofscore([1,2,3,4,5,6,7,8,9,10],4,kind = 'mean')
     35.0
     >>> percentileofscore([1,2,3,4,5,6,7,8,9,10],4,kind = 'strict')
     30.0
     >>> percentileofscore([1,2,3,4,5,6,7,8,9,10],4,kind = 'weak')
     40.0
-    
+
     # multiple - 2
     >>> percentileofscore([1,2,3,4,4,5,6,7,8,9],4)
     45.0
@@ -1079,8 +1079,8 @@
     30.0
     >>> percentileofscore([1,2,3,4,4,5,6,7,8,9],4,kind = 'weak')
     50.0
-    
-    
+
+
     # multiple - 3
     >>> percentileofscore([1,2,3,4,4,4,5,6,7,8],4)
     50.0
@@ -1090,7 +1090,7 @@
     30.0
     >>> percentileofscore([1,2,3,4,4,4,5,6,7,8],4,kind = 'weak')
     60.0
-    
+
     # missing
     >>> percentileofscore([1,2,3,5,6,7,8,9,10,11],4)
     30.0
@@ -1143,9 +1143,9 @@
     90.0
     >>> percentileofscore([ 10,20,30,50,60,70,80,90,100,110],110,kind = 'weak')
     100.0
-    
 
 
+
     #out of bounds
     >>> percentileofscore([ 10,20,30,50,60,70,80,90,100,110],200)
     100.0
@@ -1154,7 +1154,7 @@
 
 '''
 
-    
+
     a=np.array(a)
     n = len(a)
 
@@ -1164,12 +1164,12 @@
             a_len = np.array(range(len(a)))
         else:
             a_len = np.array(range(len(a))) + 1.0
-             
+
         a = np.sort(a)
         idx = [a == score]
-        pct = (np.mean(a_len[idx])/(n))*100.0             
+        pct = (np.mean(a_len[idx])/(n))*100.0
         return pct
-    
+
     elif kind == 'strict':
         return sum(a<score)/float(n)*100
     elif kind == 'weak':
@@ -2145,7 +2145,7 @@
     probability value.
 
     This function uses Chisquared aproximation of Friedman Chisquared
-    distribution. This is exact only if n > 10 and factor levels > 6. 
+    distribution. This is exact only if n > 10 and factor levels > 6.
 
     Returns: friedman chi-square statistic, associated p-valueIt assumes 3 or more repeated measures.  Only 3
     """
@@ -2155,7 +2155,7 @@
     n = len(args[0])
     for i in range(1,k):
         if len(args[i]) <> n:
-           raise ValueError, 'Unequal N in friedmanchisquare.  Aborting.'
+            raise ValueError, 'Unequal N in friedmanchisquare.  Aborting.'
     if n < 10 and k < 6:
         print 'Warning: friedmanchisquare test using Chisquared aproximation'
 
@@ -2172,7 +2172,7 @@
         for t in repnum:
             ties += t*(t*t-1)
     c = 1 - ties / float(k*(k*k-1)*n)
-    
+
     ssbn = pysum(pysum(data)**2)
     chisq = ( 12.0 / (k*n*(k+1)) * ssbn - 3*n*(k+1) ) / c
     return chisq, chisqprob(chisq,k-1)

Modified: trunk/scipy/stats/tests/test_discrete_basic.py
===================================================================
--- trunk/scipy/stats/tests/test_discrete_basic.py	2008-11-24 07:44:09 UTC (rev 5178)
+++ trunk/scipy/stats/tests/test_discrete_basic.py	2008-11-24 08:18:25 UTC (rev 5179)
@@ -132,7 +132,7 @@
 
 #next 3 functions copied from test_continous_extra
 #    adjusted
-    
+
 def check_ppf_limits(distfn,arg,msg):
     below,low,upp,above = distfn.ppf([-1,0,1,2], *arg)
     #print distfn.name, distfn.a, low, distfn.b, upp



More information about the Scipy-svn mailing list