[Numpy-svn] r3153 - trunk/numpy/lib

numpy-svn at scipy.org numpy-svn at scipy.org
Wed Sep 13 23:52:33 EDT 2006


Author: oliphant
Date: 2006-09-13 22:52:21 -0500 (Wed, 13 Sep 2006)
New Revision: 3153

Modified:
   trunk/numpy/lib/index_tricks.py
Log:
Don't deprecate c_.  Use it as short-hand for a common case

Modified: trunk/numpy/lib/index_tricks.py
===================================================================
--- trunk/numpy/lib/index_tricks.py	2006-09-14 03:36:03 UTC (rev 3152)
+++ trunk/numpy/lib/index_tricks.py	2006-09-14 03:52:21 UTC (rev 3153)
@@ -199,16 +199,18 @@
         self.col = 0
         return res
 
-    def __init__(self, axis=0, matrix=False):
+    def __init__(self, axis=0, matrix=False, ndmin=1, trans1d=-1):
         self._axis = axis
         self._matrix = matrix
         self.axis = axis
         self.matrix = matrix
         self.col = 0
+        self.trans1d = trans1d
+        self.ndmin = ndmin
 
     def __getitem__(self,key):
-        trans1d = -1
-        ndmin = 1
+        trans1d = self.trans1d
+        ndmin = self.ndmin
         if isinstance(key, str):
             frame = sys._getframe().f_back
             mymat = matrix.bmat(key,frame.f_globals,frame.f_locals)
@@ -320,15 +322,11 @@
 class c_class(concatenator):
     """Translates slice objects to concatenation along the second axis.
 
-       This is deprecated.  Use r_['-1',...]
+       This is equivalent to r_['-1,2,0',...]
     """
     def __init__(self):
-        concatenator.__init__(self, -1)
+        concatenator.__init__(self, -1, ndmin=2, trans1d=0)
 
-    def __getitem__(self, obj):
-        warnings.warn("c_ is deprecated use r_['-1',...]")
-        return concatenator.__getitem__(self, obj)
-
 c_ = c_class()
 
 class ndenumerate(object):




More information about the Numpy-svn mailing list