[Numpy-svn] r8608 - trunk/numpy/core

numpy-svn@scip... numpy-svn@scip...
Sun Aug 8 02:32:32 CDT 2010


Author: rgommers
Date: 2010-08-08 02:32:32 -0500 (Sun, 08 Aug 2010)
New Revision: 8608

Modified:
   trunk/numpy/core/shape_base.py
Log:
ENH: Make atleast_3d respect ndarray subclasses. Closes #1560.

Modified: trunk/numpy/core/shape_base.py
===================================================================
--- trunk/numpy/core/shape_base.py	2010-08-08 06:43:28 UTC (rev 8607)
+++ trunk/numpy/core/shape_base.py	2010-08-08 07:32:32 UTC (rev 8608)
@@ -1,7 +1,7 @@
 __all__ = ['atleast_1d','atleast_2d','atleast_3d','vstack','hstack']
 
 import numeric as _nx
-from numeric import array, asarray, newaxis
+from numeric import array, asanyarray, newaxis
 
 def atleast_1d(*arys):
     """
@@ -146,7 +146,7 @@
     """
     res = []
     for ary in arys:
-        ary = asarray(ary)
+        ary = asanyarray(ary)
         if len(ary.shape) == 0:
             result = ary.reshape(1,1,1)
         elif len(ary.shape) == 1:



More information about the Numpy-svn mailing list