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

numpy-svn@scip... numpy-svn@scip...
Wed Jul 9 15:49:47 CDT 2008


Author: alan.mcintyre
Date: 2008-07-09 15:49:40 -0500 (Wed, 09 Jul 2008)
New Revision: 5382

Modified:
   trunk/numpy/lib/index_tricks.py
   trunk/numpy/lib/scimath.py
Log:
Make doctests pass under new execution context.


Modified: trunk/numpy/lib/index_tricks.py
===================================================================
--- trunk/numpy/lib/index_tricks.py	2008-07-09 20:25:41 UTC (rev 5381)
+++ trunk/numpy/lib/index_tricks.py	2008-07-09 20:49:40 UTC (rev 5382)
@@ -102,7 +102,7 @@
 
     Examples
     --------
-    >>> mgrid = nd_grid()
+    >>> mgrid = np.nd_grid()
     >>> mgrid[0:5,0:5]
     array([[[0, 0, 0, 0, 0],
             [1, 1, 1, 1, 1],
@@ -319,7 +319,7 @@
     """Translates slice objects to concatenation along the first axis.
 
     For example:
-    >>> r_[array([1,2,3]), 0, 0, array([4,5,6])]
+    >>> np.r_[array([1,2,3]), 0, 0, array([4,5,6])]
     array([1, 2, 3, 0, 0, 4, 5, 6])
 
     """
@@ -332,7 +332,7 @@
     """Translates slice objects to concatenation along the second axis.
 
     For example:
-    >>> c_[array([[1,2,3]]), 0, 0, array([[4,5,6]])]
+    >>> np.c_[array([[1,2,3]]), 0, 0, array([[4,5,6]])]
     array([1, 2, 3, 0, 0, 4, 5, 6])
     """
     def __init__(self):
@@ -345,8 +345,8 @@
     A simple nd index iterator over an array.
 
     Example:
-    >>> a = array([[1,2],[3,4]])
-    >>> for index, x in ndenumerate(a):
+    >>> a = np.array([[1,2],[3,4]])
+    >>> for index, x in np.ndenumerate(a):
     ...     print index, x
     (0, 0) 1
     (0, 1) 2
@@ -369,7 +369,7 @@
     will then return an N-dimensional counter.
 
     Example:
-    >>> for index in ndindex(3,2,1):
+    >>> for index in np.ndindex(3,2,1):
     ...     print index
     (0, 0, 0)
     (0, 1, 0)

Modified: trunk/numpy/lib/scimath.py
===================================================================
--- trunk/numpy/lib/scimath.py	2008-07-09 20:25:41 UTC (rev 5381)
+++ trunk/numpy/lib/scimath.py	2008-07-09 20:49:40 UTC (rev 5382)
@@ -51,7 +51,7 @@
     >>> a = np.array([1,2,3],np.short)
 
     >>> ac = np.lib.scimath._tocomplex(a); ac
-    array([ 1.+0.j,  2.+0.j,  3.+0.j], dtype=np.complex64)
+    array([ 1.+0.j,  2.+0.j,  3.+0.j], dtype=complex64)
 
     >>> ac.dtype
     dtype('complex64')



More information about the Numpy-svn mailing list