[Scipy-svn] r4827 - trunk/scipy

scipy-svn@scip... scipy-svn@scip...
Wed Oct 22 08:53:07 CDT 2008


Author: cdavid
Date: 2008-10-22 08:52:41 -0500 (Wed, 22 Oct 2008)
New Revision: 4827

Modified:
   trunk/scipy/__init__.py
Log:
Emit a warning if numpy is < 1.2.0.

Modified: trunk/scipy/__init__.py
===================================================================
--- trunk/scipy/__init__.py	2008-10-22 08:31:32 UTC (rev 4826)
+++ trunk/scipy/__init__.py	2008-10-22 13:52:41 UTC (rev 4827)
@@ -29,6 +29,14 @@
 from numpy.fft import fft, ifft
 from numpy.lib.scimath import *
 
+# Emit a warning if numpy is too old
+majver, minver = [float(i) for i in _num.version.version.split('.')[:2]]
+if majver < 1 or (majver == 1 and minver < 2):
+    import warnings
+    warnings.warn("Numpy 1.2.0 or above is recommended for this version of " \
+                  "scipy (detected version %s)" % _num.version.version,
+                  UserWarning)
+
 __all__ += ['oldnumeric']+_num.__all__
 
 __all__ += ['randn', 'rand', 'fft', 'ifft']



More information about the Scipy-svn mailing list