[Scipy-svn] r2921 - trunk/Lib/odr

scipy-svn@scip... scipy-svn@scip...
Sun Apr 15 00:16:18 CDT 2007


Author: rkern
Date: 2007-04-15 00:16:13 -0500 (Sun, 15 Apr 2007)
New Revision: 2921

Modified:
   trunk/Lib/odr/odrpack.py
Log:
Remove dependency on scipy.linalg in favor of numpy.dual

Modified: trunk/Lib/odr/odrpack.py
===================================================================
--- trunk/Lib/odr/odrpack.py	2007-04-15 05:12:42 UTC (rev 2920)
+++ trunk/Lib/odr/odrpack.py	2007-04-15 05:16:13 UTC (rev 2921)
@@ -320,7 +320,7 @@
     covx and covy are arrays of covariance matrices and are converted to weights
     by performing a matrix inversion on each observation's covariance matrix.
 
-      E.g.  we[i] = scipy.linalg.inv(covy[i])  # i in range(len(covy))
+      E.g.  we[i] = numpy.linalg.inv(covy[i])  # i in range(len(covy))
                                                #   if covy.shape == (n,q,q)
 
     These arguments follow the same structured argument conventions as wd and we
@@ -376,15 +376,15 @@
         """ Convert covariance matrix(-ices) to weights.
         """
 
-        from scipy import linalg
+        from numpy.dual import inv
 
         if len(cov.shape) == 2:
-            return linalg.inv(cov)
+            return inv(cov)
         else:
             weights = numpy.zeros(cov.shape, float)
 
             for i in range(cov.shape[-1]):  # n
-                weights[:,:,i] = linalg.inv(cov[:,:,i])
+                weights[:,:,i] = inv(cov[:,:,i])
 
             return weights
 



More information about the Scipy-svn mailing list