summaryrefslogtreecommitdiff
path: root/numpy/__init__.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2013-06-09 21:44:06 -0600
committerCharles Harris <charlesr.harris@gmail.com>2013-06-10 16:30:10 -0600
commita9a470c841eeb5f0fb2c2ae9639f6c2833f03d00 (patch)
tree096b749d7857c78677e6222eb8fadad5b7cfccd7 /numpy/__init__.py
parent75cdf3d82e96e4fb605f3b0ea85961bbc24e70d8 (diff)
downloadnumpy-a9a470c841eeb5f0fb2c2ae9639f6c2833f03d00.tar.gz
DEP: Deprecate the oldnumeric and numarray modules.
The numarray and oldnumeric modules are deprecated. This is a bit tricky as raising a DeprecationWarning on import causes an error when tests are run. To deal with that, a ModuleDeprecationWarning class is added to numpy and NoseTester is modified to ignore that warning during testing. Closes #2905
Diffstat (limited to 'numpy/__init__.py')
-rw-r--r--numpy/__init__.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/numpy/__init__.py b/numpy/__init__.py
index bbbecd6f6..b4be4d707 100644
--- a/numpy/__init__.py
+++ b/numpy/__init__.py
@@ -108,6 +108,19 @@ from __future__ import division, absolute_import, print_function
import sys
+
+class ModuleDeprecationWarning(DeprecationWarning):
+ """Module deprecation warning.
+
+ The nose tester turns ordinary Deprecation warnings into test failures.
+ That makes it hard to deprecate whole modules, because they get
+ imported by default. So this is a special Deprecation warning that the
+ nose tester will let pass without making tests fail.
+
+ """
+ pass
+
+
# We first need to detect if we're being called as part of the numpy setup
# procedure itself in a reliable manner.
try:
@@ -138,7 +151,7 @@ else:
return loader(*packages, **options)
from . import add_newdocs
- __all__ = ['add_newdocs']
+ __all__ = ['add_newdocs', 'ModuleDeprecationWarning']
pkgload.__doc__ = PackageLoader.__call__.__doc__