[Scipy-svn] r4327 - in branches/refactor_fft: . scipy/sparse scipy/sparse/tests scipy/stats scipy/weave

scipy-svn at scipy.org scipy-svn at scipy.org
Wed May 14 02:46:26 EDT 2008


Author: cdavid
Date: 2008-05-14 01:46:10 -0500 (Wed, 14 May 2008)
New Revision: 4327

Modified:
   branches/refactor_fft/
   branches/refactor_fft/scipy/sparse/csr.py
   branches/refactor_fft/scipy/sparse/tests/test_base.py
   branches/refactor_fft/scipy/stats/stats.py
   branches/refactor_fft/scipy/weave/standard_array_spec.py
Log:
Merged revisions 4253-4326 via svnmerge from 
http://svn.scipy.org/svn/scipy/trunk

........
  r4294 | wnbell | 2008-05-13 05:15:50 +0900 (Tue, 13 May 2008) | 4 lines
  
  fixed indexing bug reported by Robert Cimrman
  http://thread.gmane.org/gmane.comp.python.scientific.devel/7986
........
  r4325 | rkern | 2008-05-14 03:08:11 +0900 (Wed, 14 May 2008) | 1 line
  
  More const-correctness fixes from Norbert Nemec.
........
  r4326 | oliphant | 2008-05-14 07:42:35 +0900 (Wed, 14 May 2008) | 1 line
  
  Fixed formula for standard error according to Greene -- Econometrics pg. 160.
........



Property changes on: branches/refactor_fft
___________________________________________________________________
Name: svnmerge-integrated
   - /branches/build_with_scons:1-3868 /branches/scipy.scons:1-3533 /branches/sparse_build_reduce_mem:1-4005 /branches/testing_cleanup:1-3662 /trunk:1-4252
   + /branches/build_with_scons:1-3868 /branches/scipy.scons:1-3533 /branches/sparse_build_reduce_mem:1-4005 /branches/testing_cleanup:1-3662 /trunk:1-4326

Modified: branches/refactor_fft/scipy/sparse/csr.py
===================================================================
--- branches/refactor_fft/scipy/sparse/csr.py	2008-05-13 22:42:35 UTC (rev 4326)
+++ branches/refactor_fft/scipy/sparse/csr.py	2008-05-14 06:46:10 UTC (rev 4327)
@@ -363,7 +363,8 @@
         check_bounds( j0, j1, N )
 
         indptr, indices, data = get_csr_submatrix( M, N, \
-                self.indptr, self.indices, self.data, i0, i1, j0, j1 )
+                self.indptr, self.indices, self.data, \
+                int(i0), int(i1), int(j0), int(j1) )
 
         shape =  (i1 - i0, j1 - j0)
 

Modified: branches/refactor_fft/scipy/sparse/tests/test_base.py
===================================================================
--- branches/refactor_fft/scipy/sparse/tests/test_base.py	2008-05-13 22:42:35 UTC (rev 4326)
+++ branches/refactor_fft/scipy/sparse/tests/test_base.py	2008-05-14 06:46:10 UTC (rev 4327)
@@ -679,6 +679,13 @@
         assert_equal(A[:,2].todense(),B[:,2])
         assert_equal(A[3:4,9].todense(),B[3:4,9])
         assert_equal(A[1:4,-5].todense(),B[1:4,-5])
+        assert_equal(A[2:-1,3].todense(),B[2:-1,3])
+        
+        # [1:2,1:2]
+        assert_equal(A[1:2,1:2].todense(),B[1:2,1:2])
+        assert_equal(A[4:,3:].todense(),B[4:,3:])
+        assert_equal(A[:4,:5].todense(),B[:4,:5])
+        assert_equal(A[2:-1,:5].todense(),B[2:-1,:5])
 
         # [1:2,[1,2]]
         assert_equal(A[:,[2,8,3,-1]].todense(),B[:,[2,8,3,-1]])
@@ -721,6 +728,13 @@
         assert_equal(A[:,[1,3]][[2,4],:].todense(),    B[:,[1,3]][[2,4],:]    )
         assert_equal(A[:,[-1,-3]][[2,-4],:].todense(), B[:,[-1,-3]][[2,-4],:] )
 
+
+        # Check bug reported by Robert Cimrman:
+        # http://thread.gmane.org/gmane.comp.python.scientific.devel/7986 
+        s = slice(numpy.int8(2),numpy.int8(4),None)
+        assert_equal(A[s,:].todense(), B[2:4,:])
+        assert_equal(A[:,s].todense(), B[:,2:4])
+        
 class _TestArithmetic:
     """
     Test real/complex arithmetic

Modified: branches/refactor_fft/scipy/stats/stats.py
===================================================================
--- branches/refactor_fft/scipy/stats/stats.py	2008-05-13 22:42:35 UTC (rev 4326)
+++ branches/refactor_fft/scipy/stats/stats.py	2008-05-14 06:46:10 UTC (rev 4327)
@@ -1661,7 +1661,7 @@
     prob = betai(0.5*df,0.5,df/(df+t*t))
     slope = r_num / ss(xm)
     intercept = ymean - slope*xmean
-    sterrest = np.sqrt(1-r*r)*samplestd(y)
+    sterrest = np.sqrt((1-r*r)*ss(y) / ss(x) / df)
     return slope, intercept, r, prob, sterrest
 
 

Modified: branches/refactor_fft/scipy/weave/standard_array_spec.py
===================================================================
--- branches/refactor_fft/scipy/weave/standard_array_spec.py	2008-05-13 22:42:35 UTC (rev 4326)
+++ branches/refactor_fft/scipy/weave/standard_array_spec.py	2008-05-14 06:46:10 UTC (rev 4327)
@@ -41,7 +41,7 @@
         if (!PyArray_EquivTypenums(arr_type, numeric_type))
         {
 
-        char* type_names[23] = {"bool", "byte", "ubyte","short", "ushort",
+        const char* type_names[23] = {"bool", "byte", "ubyte","short", "ushort",
                                 "int", "uint", "long", "ulong", "longlong", "ulonglong",
                                 "float", "double", "longdouble", "cfloat", "cdouble",
                                 "clongdouble", "object", "string", "unicode", "void", "ntype",
@@ -66,7 +66,7 @@
         }
         if (!PyArray_EquivTypenums(arr_type, numeric_type))
         {
-            char* type_names[23] = {"bool", "byte", "ubyte","short", "ushort",
+            const char* type_names[23] = {"bool", "byte", "ubyte","short", "ushort",
                                     "int", "uint", "long", "ulong", "longlong", "ulonglong",
                                     "float", "double", "longdouble", "cfloat", "cdouble",
                                     "clongdouble", "object", "string", "unicode", "void", "ntype",




More information about the Scipy-svn mailing list