[Numpy-svn] r5704 - in trunk/numpy: lib testing

numpy-svn@scip... numpy-svn@scip...
Tue Aug 26 13:41:58 CDT 2008


Author: alan.mcintyre
Date: 2008-08-26 13:41:53 -0500 (Tue, 26 Aug 2008)
New Revision: 5704

Modified:
   trunk/numpy/lib/setup.py
   trunk/numpy/testing/nosetester.py
Log:
Added benchmarks directory to lib/setup.py so that numpy.lib benchmarks are 
available in an installed NumPy.
Display system configuration information when benchmarks are run.


Modified: trunk/numpy/lib/setup.py
===================================================================
--- trunk/numpy/lib/setup.py	2008-08-26 05:32:57 UTC (rev 5703)
+++ trunk/numpy/lib/setup.py	2008-08-26 18:41:53 UTC (rev 5704)
@@ -12,6 +12,7 @@
                          sources=[join('src','_compiled_base.c')]
                          )
 
+    config.add_data_dir('benchmarks')
     config.add_data_dir('tests')
 
     return config

Modified: trunk/numpy/testing/nosetester.py
===================================================================
--- trunk/numpy/testing/nosetester.py	2008-08-26 05:32:57 UTC (rev 5703)
+++ trunk/numpy/testing/nosetester.py	2008-08-26 18:41:53 UTC (rev 5704)
@@ -144,7 +144,25 @@
             argv += extra_argv
         return argv
 
+    def _show_system_info(self):
+        nose = import_nose()
 
+        import numpy
+        print "NumPy version %s" % numpy.__version__
+        npdir = os.path.dirname(numpy.__file__)
+        print "NumPy is installed in %s" % npdir
+
+        if 'scipy' in self.package_name:
+            import scipy
+            print "SciPy version %s" % scipy.__version__
+            spdir = os.path.dirname(scipy.__file__)
+            print "SciPy is installed in %s" % spdir
+
+        pyversion = sys.version.replace('\n','')
+        print "Python version %s" % pyversion
+        print "nose version %d.%d.%d" % nose.__versioninfo__
+            
+
     def test(self, label='fast', verbose=1, extra_argv=None, doctests=False,
              coverage=False, **kwargs):
         ''' Run tests for module using nose
@@ -216,23 +234,10 @@
         argv += ['--exclude','swig_ext']
         argv += ['--exclude','array_from_pyobj']
 
+        self._show_system_info()
+
         nose = import_nose()
 
-        import numpy
-        print "NumPy version %s" % numpy.__version__
-        npdir = os.path.dirname(numpy.__file__)
-        print "NumPy is installed in %s" % npdir
-
-        if 'scipy' in self.package_name:
-            import scipy
-            print "SciPy version %s" % scipy.__version__
-            spdir = os.path.dirname(scipy.__file__)
-            print "SciPy is installed in %s" % spdir
-
-        pyversion = sys.version.replace('\n','')
-        print "Python version %s" % pyversion
-        print "nose version %d.%d.%d" % nose.__versioninfo__
-
         # Because nose currently discards the test result object, but we need
         # to return it to the user, override TestProgram.runTests to retain
         # the result
@@ -274,6 +279,10 @@
         ''' Run benchmarks for module using nose
 
         %(test_header)s'''
+
+        print "Running benchmarks for %s" % self.package_name
+        self._show_system_info()
+
         nose = import_nose()
         argv = self._test_argv(label, verbose, extra_argv)
         argv += ['--match', r'(?:^|[\\b_\\.%s-])[Bb]ench' % os.sep]



More information about the Numpy-svn mailing list