summaryrefslogtreecommitdiff
path: root/numpy/oldnumeric/compat.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-06-15 03:39:43 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-06-15 03:39:43 +0000
commit2f4a9678f04a3eab6878f4694231d4848e127490 (patch)
treed1d7288995146b78f63b643afe2af99b3ddb1087 /numpy/oldnumeric/compat.py
parent439ea9dc39d6ab0c4052b0881d0f6fed5e8c344f (diff)
downloadnumpy-2f4a9678f04a3eab6878f4694231d4848e127490.tar.gz
Expose deprecate function
Diffstat (limited to 'numpy/oldnumeric/compat.py')
-rw-r--r--numpy/oldnumeric/compat.py23
1 files changed, 9 insertions, 14 deletions
diff --git a/numpy/oldnumeric/compat.py b/numpy/oldnumeric/compat.py
index ca9d32044..b5d31334e 100644
--- a/numpy/oldnumeric/compat.py
+++ b/numpy/oldnumeric/compat.py
@@ -129,24 +129,19 @@ except AttributeError:
else:
__all__ += ['Complex128']
-def _deprecate(func, oldname, newname):
- import warnings
- def newfunc(*args,**kwds):
- warnings.warn("%s is deprecated, use %s" % (oldname, newname),
- DeprecationWarning)
- return func(*args, **kwds)
- return newfunc
+
+from numpy import deprecate
# backward compatibility
-arrayrange = _deprecate(mu.arange, 'arrayrange', 'arange')
-cross_correlate = _deprecate(correlate, 'cross_correlate', 'correlate')
-cross_product = _deprecate(cross, 'cross_product', 'cross')
-divide_safe = _deprecate(um.divide, 'divide_safe', 'divide')
+arrayrange = deprecate(mu.arange, 'arrayrange', 'arange')
+cross_correlate = deprecate(correlate, 'cross_correlate', 'correlate')
+cross_product = deprecate(cross, 'cross_product', 'cross')
+divide_safe = deprecate(um.divide, 'divide_safe', 'divide')
# deprecated names
-matrixmultiply = _deprecate(mu.dot, 'matrixmultiply', 'dot')
-outerproduct = _deprecate(outer, 'outerproduct', 'outer')
-innerproduct = _deprecate(mu.inner, 'innerproduct', 'inner')
+matrixmultiply = deprecate(mu.dot, 'matrixmultiply', 'dot')
+outerproduct = deprecate(outer, 'outerproduct', 'outer')
+innerproduct = deprecate(mu.inner, 'innerproduct', 'inner')