[Scipy-svn] r6930 - trunk/scipy/sparse

scipy-svn at scipy.org scipy-svn at scipy.org
Sat Nov 20 11:25:57 EST 2010


Author: warren.weckesser
Date: 2010-11-20 10:25:57 -0600 (Sat, 20 Nov 2010)
New Revision: 6930

Modified:
   trunk/scipy/sparse/bsr.py
   trunk/scipy/sparse/coo.py
   trunk/scipy/sparse/dok.py
Log:
BUG: sparse: fix a few undefined names found by pyflakes (but there are more down in the subdirectories of linalg)

Modified: trunk/scipy/sparse/bsr.py
===================================================================
--- trunk/scipy/sparse/bsr.py	2010-11-20 16:05:57 UTC (rev 6929)
+++ trunk/scipy/sparse/bsr.py	2010-11-20 16:25:57 UTC (rev 6930)
@@ -228,7 +228,7 @@
                     raise ValueError("column index values must be < %d" % (N//C))
                 if self.indices.min() < 0:
                     raise ValueError("column index values must be >= 0")
-                if diff(self.indptr).min() < 0:
+                if np.diff(self.indptr).min() < 0:
                     raise ValueError("index pointer values must form a "
                                         "non-decreasing sequence")
 

Modified: trunk/scipy/sparse/coo.py
===================================================================
--- trunk/scipy/sparse/coo.py	2010-11-20 16:05:57 UTC (rev 6929)
+++ trunk/scipy/sparse/coo.py	2010-11-20 16:25:57 UTC (rev 6930)
@@ -11,7 +11,7 @@
 from sparsetools import coo_tocsr, coo_todense, coo_matvec
 from base import isspmatrix
 from data import _data_matrix
-from sputils import upcast, to_native, isshape, getdtype
+from sputils import upcast, to_native, isshape, getdtype, isintlike
 
 class coo_matrix(_data_matrix):
     """

Modified: trunk/scipy/sparse/dok.py
===================================================================
--- trunk/scipy/sparse/dok.py	2010-11-20 16:05:57 UTC (rev 6929)
+++ trunk/scipy/sparse/dok.py	2010-11-20 16:25:57 UTC (rev 6930)
@@ -448,7 +448,7 @@
         M, N = self.shape
         new = dok_matrix((N, M), dtype=self.dtype)
         for key, value in self.iteritems():
-            new[key[1], key[0]] = conj(value)
+            new[key[1], key[0]] = np.conj(value)
         return new
 
     def copy(self):
@@ -464,13 +464,13 @@
         N = len(cols_or_rows)
         if indx: # columns
             for key in self.keys():
-                num = searchsorted(cols_or_rows, key[1])
+                num = np.searchsorted(cols_or_rows, key[1])
                 if num < N:
                     newkey = (key[0], num)
                     new[newkey] = self[key]
         else:
             for key in self.keys():
-                num = searchsorted(cols_or_rows, key[0])
+                num = np.searchsorted(cols_or_rows, key[0])
                 if num < N:
                     newkey = (num, key[1])
                     new[newkey] = self[key]
@@ -484,7 +484,7 @@
         indx = int((columns == 1))
         if indx:
             for key in self.keys():
-                num = searchsorted(cols_or_rows, key[1])
+                num = np.searchsorted(cols_or_rows, key[1])
                 if cols_or_rows[num] == key[1]:
                     newkey = (key[0], num)
                     ext[newkey] = self[key]
@@ -493,7 +493,7 @@
                     base[newkey] = self[key]
         else:
             for key in self.keys():
-                num = searchsorted(cols_or_rows, key[0])
+                num = np.searchsorted(cols_or_rows, key[0])
                 if cols_or_rows[num] == key[0]:
                     newkey = (num, key[1])
                     ext[newkey] = self[key]




More information about the Scipy-svn mailing list