[Scipy-svn] r3191 - trunk/Lib/sparse

scipy-svn@scip... scipy-svn@scip...
Wed Jul 25 20:01:18 CDT 2007


Author: wnbell
Date: 2007-07-25 20:01:14 -0500 (Wed, 25 Jul 2007)
New Revision: 3191

Modified:
   trunk/Lib/sparse/sparse.py
Log:
when returning new arrays, copy .indptr and .indices by default


Modified: trunk/Lib/sparse/sparse.py
===================================================================
--- trunk/Lib/sparse/sparse.py	2007-07-25 17:27:45 UTC (rev 3190)
+++ trunk/Lib/sparse/sparse.py	2007-07-26 01:01:14 UTC (rev 3191)
@@ -480,11 +480,11 @@
                (self.shape + (self.dtype.type, self.getnnz(), self.nzmax, \
                    _formats[format][1]))
     
-    def _with_data(self,data,copy=False):
+    def _with_data(self,data,copy=True):
         """
         Return a matrix with the same sparsity structure as self,
         but with different data.  By default the structure arrays
-        (i.e. .indptr and .indices) are not copied.
+        (i.e. .indptr and .indices) are copied.
         """
         if copy:
             return self.__class__((data,self.indices.copy(),self.indptr.copy()), \



More information about the Scipy-svn mailing list