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

numpy-svn at scipy.org numpy-svn at scipy.org
Wed Dec 26 02:04:26 EST 2007


Author: cookedm
Date: 2007-12-26 01:04:24 -0600 (Wed, 26 Dec 2007)
New Revision: 4644

Modified:
   trunk/numpy/lib/index_tricks.py
Log:
Convert some internal classes in index_tricks.py to CamelCase


Modified: trunk/numpy/lib/index_tricks.py
===================================================================
--- trunk/numpy/lib/index_tricks.py	2007-12-26 07:03:34 UTC (rev 4643)
+++ trunk/numpy/lib/index_tricks.py	2007-12-26 07:04:24 UTC (rev 4644)
@@ -1,5 +1,3 @@
-## Automatically adapted for numpy Sep 19, 2005 by convertcode.py
-
 __all__ = ['unravel_index',
            'mgrid',
            'ogrid',
@@ -48,7 +46,7 @@
     # Reverse
     # [dcb,dc,d,1]
     dim_prod = _nx.cumprod([1] + list(dims)[:0:-1])[::-1]
-    # Indeces become [x/dcb % a, x/dc % b, x/d % c, x/1 % d]
+    # Indices become [x/dcb % a, x/dc % b, x/d % c, x/1 % d]
     return tuple(x/dim_prod % dims)
 
 def ix_(*args):
@@ -193,7 +191,7 @@
 mgrid = nd_grid(sparse=False)
 ogrid = nd_grid(sparse=True)
 
-class concatenator(object):
+class AxisConcatenator(object):
     """Translates slice objects to concatenation along an axis.
     """
     def _retval(self, res):
@@ -313,26 +311,30 @@
 # etc. because otherwise we couldn't get the doc string to come out right
 # in help(r_)
 
-class r_class(concatenator):
+class RClass(AxisConcatenator):
     """Translates slice objects to concatenation along the first axis.
 
-        For example:
-        >>> r_[array([1,2,3]), 0, 0, array([4,5,6])]
-        array([1, 2, 3, 0, 0, 4, 5, 6])
+    For example:
+    >>> r_[array([1,2,3]), 0, 0, array([4,5,6])]
+    array([1, 2, 3, 0, 0, 4, 5, 6])
 
     """
     def __init__(self):
-        concatenator.__init__(self, 0)
+        AxisConcatenator.__init__(self, 0)
 
-r_ = r_class()
+r_ = RClass()
 
-class c_class(concatenator):
+class CClass(AxisConcatenator):
     """Translates slice objects to concatenation along the second axis.
+
+    For example:
+    >>> c_[array([[1,2,3]]), 0, 0, array([[4,5,6]])]
+    array([1, 2, 3, 0, 0, 4, 5, 6])
     """
     def __init__(self):
-        concatenator.__init__(self, -1, ndmin=2, trans1d=0)
+        AxisConcatenator.__init__(self, -1, ndmin=2, trans1d=0)
 
-c_ = c_class()
+c_ = CClass()
 
 class ndenumerate(object):
     """
@@ -423,7 +425,7 @@
 #
 #
 
-class _index_expression_class(object):
+class IndexExpression(object):
     """
     A nicer way to build up index tuples for arrays.
 
@@ -451,7 +453,7 @@
             stop = None
         return self[start:stop:None]
 
-index_exp = _index_expression_class(1)
-s_ = _index_expression_class(0)
+index_exp = IndexExpression(maketuple=True)
+s_ = IndexExpression(maketuple=False)
 
 # End contribution from Konrad.




More information about the Numpy-svn mailing list