diff options
Diffstat (limited to 'numpy/lib')
-rw-r--r-- | numpy/lib/convertnumericA.py | 30 | ||||
-rw-r--r-- | numpy/lib/convertnumericB.py | 4 | ||||
-rw-r--r-- | numpy/lib/mlab.py | 18 | ||||
-rw-r--r-- | numpy/lib/user_array.py (renamed from numpy/lib/UserArray.py) | 8 |
4 files changed, 21 insertions, 39 deletions
diff --git a/numpy/lib/convertnumericA.py b/numpy/lib/convertnumericA.py index 446d81e3d..ad1daa329 100644 --- a/numpy/lib/convertnumericA.py +++ b/numpy/lib/convertnumericA.py @@ -73,21 +73,21 @@ import datetime def fromstr(filestr): #filestr = replacetypechars(filestr) filestr, fromall1 = changeimports(filestr, 'Numeric', 'numpy.oldnumeric') - filestr, fromall1 = changeimports(filestr, 'multiarray', - 'numpy.core.multiarray') - filestr, fromall1 = changeimports(filestr, 'umath', - 'numpy.core.umath') - filestr, fromall1 = changeimports(filestr, 'Precision', 'numpy.oldnumeric') - filestr, fromall2 = changeimports(filestr, 'numerix', 'numpy') - filestr, fromall3 = changeimports(filestr, 'scipy_base', 'numpy') - filestr, fromall3 = changeimports(filestr, 'MLab', 'numpy.lib.mlab') - filestr, fromall3 = changeimports(filestr, 'LinearAlgebra', - 'numpy.linalg.old') - filestr, fromall3 = changeimports(filestr, 'RNG', 'numpy.random.oldrng') - filestr, fromall3 = changeimports(filestr, 'RNG.Statistics', 'numpy.random.oldrngstats') - filestr, fromall3 = changeimports(filestr, 'RandomArray', 'numpy.random.oldrandomarray') - filestr, fromall3 = changeimports(filestr, 'FFT', 'numpy.dft.old') - filestr, fromall3 = changeimports(filestr, 'MA', 'numpy.core.ma') + filestr, fromall1 = changeimports(filestr, 'multiarray','numpy.oldnumeric') + filestr, fromall1 = changeimports(filestr, 'umath', 'numpy.oldnumeric') + filestr, fromall1 = changeimports(filestr, 'Precision', 'numpy.oldnumeric.precision') + filestr, fromall1 = changeimports(filestr, 'UserArray', 'numpy.oldnumeric.user_array') + filestr, fromall1 = changeimports(filestr, 'ArrayPrinter', 'numpy.oldnumeric.array_printer') + filestr, fromall2 = changeimports(filestr, 'numerix', 'numpy.oldnumeric') + filestr, fromall3 = changeimports(filestr, 'scipy_base', 'numpy.oldnumeric') + filestr, fromall3 = changeimports(filestr, 'Matrix', 'numpy.oldnumeric.matrix') + filestr, fromall3 = changeimports(filestr, 'MLab', 'numpy.oldnumeric.mlab') + filestr, fromall3 = changeimports(filestr, 'LinearAlgebra', 'numpy.oldnumeric.linear_algebra') + filestr, fromall3 = changeimports(filestr, 'RNG', 'numpy.oldnumeric.rng') + filestr, fromall3 = changeimports(filestr, 'RNG.Statistics', 'numpy.oldnumeric.rng_stats') + filestr, fromall3 = changeimports(filestr, 'RandomArray', 'numpy.oldnumeric.random_array') + filestr, fromall3 = changeimports(filestr, 'FFT', 'numpy.oldnumeric.fft') + filestr, fromall3 = changeimports(filestr, 'MA', 'numpy.oldnumeric.ma') fromall = fromall1 or fromall2 or fromall3 filestr = replaceattr(filestr) filestr = replaceother(filestr) diff --git a/numpy/lib/convertnumericB.py b/numpy/lib/convertnumericB.py index cd26723a3..36bdd8572 100644 --- a/numpy/lib/convertnumericB.py +++ b/numpy/lib/convertnumericB.py @@ -56,7 +56,7 @@ def changeimports(fstr, name, newname): return fstr, fromall def replaceattr(astr): - astr = astr.replace("matrixmultiply","dot") + astr = astr.replace("matrixmultiply","dot") return astr def replaceother(astr): @@ -76,7 +76,7 @@ def fromstr(filestr): filestr, fromall3 = changeimports(filestr, 'RNG', 'numpy.random.oldrng') filestr, fromall3 = changeimports(filestr, 'RNG.Statistics', 'numpy.random.oldrngstats') filestr, fromall3 = changeimports(filestr, 'RandomArray', 'numpy.random.oldrandomarray') - filestr, fromall3 = changeimports(filestr, 'FFT', 'numpy.dft.old') + filestr, fromall3 = changeimports(filestr, 'FFT', 'numpy.fft.old') filestr, fromall3 = changeimports(filestr, 'MA', 'numpy.core.ma') fromall = fromall1 or fromall2 or fromall3 filestr = replaceattr(filestr) diff --git a/numpy/lib/mlab.py b/numpy/lib/mlab.py deleted file mode 100644 index fd66ecd70..000000000 --- a/numpy/lib/mlab.py +++ /dev/null @@ -1,18 +0,0 @@ -# This module is for compatibility only. All functions are defined elsewhere. - -from numpy.core.numeric import * - -from twodim_base import diag, fliplr, flipud, rot90, tril, triu - -# use old defaults -from numpy.oldnumeric import eye, tri - -from numpy.core.fromnumeric import amax as max, amin as min -from function_base import msort, median, trapz, diff, cov, corrcoef, \ - kaiser, blackman, bartlett, hanning, hamming, sinc, angle -from numpy.core.fromnumeric import cumsum, ptp, mean, std, prod, cumprod, \ - squeeze -from polynomial import roots - -from numpy.random import rand, randn -from numpy.dual import eig, svd diff --git a/numpy/lib/UserArray.py b/numpy/lib/user_array.py index 0d74450d5..d20593f45 100644 --- a/numpy/lib/UserArray.py +++ b/numpy/lib/user_array.py @@ -1,5 +1,5 @@ """ -Standard container-class for easy backward compatibility with Numeric. +Standard container-class for easy multiple-inheritance. Try to inherit from the ndarray instead of using this class as this is not complete. """ @@ -9,7 +9,7 @@ from numpy.core import array, asarray, absolute, add, subtract, multiply, \ bitwise_or, bitwise_xor, invert, less, less_equal, not_equal, equal, \ greater, greater_equal, shape, reshape, arange, sin, sqrt, transpose -class UserArray(object): +class container(object): def __init__(self, data, dtype=None, copy=True): self.array = array(data, dtype, copy=copy) @@ -196,12 +196,12 @@ class UserArray(object): return self.array.__getattribute__(attr) ############################################################# -# Test of class UserArray +# Test of class container ############################################################# if __name__ == '__main__': temp=reshape(arange(10000),(100,100)) - ua=UserArray(temp) + ua=container(temp) # new object created begin test print dir(ua) print shape(ua),ua.shape # I have changed Numeric.py |