[Numpy-svn] r8609 - branches/1.5.x/numpy/core

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


Author: rgommers
Date: 2010-08-08 02:33:42 -0500 (Sun, 08 Aug 2010)
New Revision: 8609

Modified:
   branches/1.5.x/numpy/core/shape_base.py
Log:
ENH: (backport of r8608) Make atleast_3d respect ndarray subclasses. Closes #1560.

Modified: branches/1.5.x/numpy/core/shape_base.py
===================================================================
--- branches/1.5.x/numpy/core/shape_base.py	2010-08-08 07:32:32 UTC (rev 8608)
+++ branches/1.5.x/numpy/core/shape_base.py	2010-08-08 07:33:42 UTC (rev 8609)
@@ -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