[Numpy-svn] r3095 - in trunk/numpy: . core

numpy-svn at scipy.org numpy-svn at scipy.org
Tue Aug 29 13:15:39 EDT 2006


Author: oliphant
Date: 2006-08-29 12:15:31 -0500 (Tue, 29 Aug 2006)
New Revision: 3095

Modified:
   trunk/numpy/__init__.py
   trunk/numpy/core/__init__.py
   trunk/numpy/core/fromnumeric.py
   trunk/numpy/core/numeric.py
   trunk/numpy/matlib.py
Log:
Fix problem with randn in matlib.  Acutally add min, max, round, abs to the numpy name-space without over-writing builtins on from numpy import *

Modified: trunk/numpy/__init__.py
===================================================================
--- trunk/numpy/__init__.py	2006-08-29 10:28:11 UTC (rev 3094)
+++ trunk/numpy/__init__.py	2006-08-29 17:15:31 UTC (rev 3095)
@@ -36,15 +36,17 @@
     from core import *
     import lib
     from lib import *
-    # Make these accessible from numpy name-space
-    #  but not imported in from numpy import *
-    from __builtin__ import bool, int, long, float, complex, \
-         object, unicode, str
     import linalg
     import fft
     import random
     import ctypeslib
 
+    # Make these accessible from numpy name-space
+    #  but not imported in from numpy import *
+    from __builtin__ import bool, int, long, float, complex, \
+         object, unicode, str
+    from core import round, abs, max, min
+
     __all__ = ['__version__', 'pkgload', 'PackageLoader',
                'ScipyTest', 'NumpyTest', 'show_config']
     __all__ += core.__all__

Modified: trunk/numpy/core/__init__.py
===================================================================
--- trunk/numpy/core/__init__.py	2006-08-29 10:28:11 UTC (rev 3094)
+++ trunk/numpy/core/__init__.py	2006-08-29 17:15:31 UTC (rev 3095)
@@ -19,6 +19,10 @@
 import scalarmath
 del nt
 
+from fromnumeric import amax as max, amin as min, \
+     round_ as round
+from numeric import absolute as abs
+
 __all__ = ['char','rec','memmap','ma']
 __all__ += numeric.__all__
 __all__ += fromnumeric.__all__

Modified: trunk/numpy/core/fromnumeric.py
===================================================================
--- trunk/numpy/core/fromnumeric.py	2006-08-29 10:28:11 UTC (rev 3094)
+++ trunk/numpy/core/fromnumeric.py	2006-08-29 17:15:31 UTC (rev 3095)
@@ -439,8 +439,6 @@
         return _wrapit(a, 'max', axis, out)
     return amax(axis, out)
 
-max = amax
-
 def amin(a, axis=None, out=None):
     """Return the minimum of a along dimension axis.
     """
@@ -450,8 +448,6 @@
         return _wrapit(a, 'min', axis, out)
     return amin(axis, out)
 
-min = amin
-
 def alen(a):
     """Return the length of a Python object interpreted as an array
     of at least 1 dimension.
@@ -522,8 +518,6 @@
 
 around = round_
 
-round = round_
-
 def mean(a, axis=None, dtype=None, out=None):
     """mean(a, axis=None, dtype=None)
     Return the arithmetic mean.

Modified: trunk/numpy/core/numeric.py
===================================================================
--- trunk/numpy/core/numeric.py	2006-08-29 10:28:11 UTC (rev 3094)
+++ trunk/numpy/core/numeric.py	2006-08-29 17:15:31 UTC (rev 3095)
@@ -95,8 +95,6 @@
 extend_all(umath)
 extend_all(numerictypes)
 
-abs = absolute
-
 newaxis = None
 
 ndarray = multiarray.ndarray

Modified: trunk/numpy/matlib.py
===================================================================
--- trunk/numpy/matlib.py	2006-08-29 10:28:11 UTC (rev 3094)
+++ trunk/numpy/matlib.py	2006-08-29 17:15:31 UTC (rev 3095)
@@ -46,6 +46,6 @@
 def randn(*args):
     if isinstance(args[0], tuple):
        args = args[0]
-    return asmatrix(N.random.rand(*args))
+    return asmatrix(N.random.randn(*args))
 
     




More information about the Numpy-svn mailing list