[Numpy-discussion] Removing deprecated names

Ed Schofield schofield at ftw.at
Sun Jun 4 12:02:17 CDT 2006


Hi all,

I've created four patches to remove deprecated names from the  
numpy.core and numpy namespaces by default.  The motivation for this  
is to provide a clear separation for both new users and users  
migrating from Numeric between those names that are deprecated and  
those that are recommended.

The first patch cleans up NumPy to avoid the use of deprecated names  
internally:

http://projects.scipy.org/scipy/numpy/ticket/137

The second patch separates the Numeric-like function interfaces,  
which Travis has said he doesn't want to deprecate, from the other  
names in oldnumeric.py, which include the capitalized type names,  
arrayrange, matrixmultiply, outerproduct, NewAxis, and a few others:

http://projects.scipy.org/scipy/numpy/ticket/138


The third patch removes the deprecated names from the numpy.core and  
numpy namespaces and adds a compatibility function, numpy.Numeric(),  
that imports the deprecated interfaces into the namespace as before:

http://projects.scipy.org/scipy/numpy/ticket/139

The fourth patch (also in ticket #139) is a script that adds the line  
"numpy.Numeric()" to the appropriate place in all Python files in the  
specified directory.  I've tested this on the SciPy source tree,  
which still uses the old Numeric interfaces in many places.  After  
running the script, SciPy runs all its 1518 unit tests without errors.

These patches make a fairly small difference to the size of NumPy's  
default namespace:

 >>> import numpy
 >>> len(dir(numpy))
438
 >>> numpy.Numeric()
 >>> len(dir(numpy))
484

They do, however, help to support Python principle #13 ...

-- Ed




More information about the Numpy-discussion mailing list