[Numpy-svn] r8703 - in branches/1.5.x: numpy/core/tests tools

numpy-svn@scip... numpy-svn@scip...
Sat Sep 11 11:08:55 CDT 2010


Author: ptvirtan
Date: 2010-09-11 11:08:55 -0500 (Sat, 11 Sep 2010)
New Revision: 8703

Modified:
   branches/1.5.x/numpy/core/tests/test_blasdot.py
   branches/1.5.x/tools/py3tool.py
Log:
BUG: (backport r8699) core: fix _dotblas usage on Py3 (fixes #1609)

Modified: branches/1.5.x/numpy/core/tests/test_blasdot.py
===================================================================
--- branches/1.5.x/numpy/core/tests/test_blasdot.py	2010-09-11 15:56:32 UTC (rev 8702)
+++ branches/1.5.x/numpy/core/tests/test_blasdot.py	2010-09-11 16:08:55 UTC (rev 8703)
@@ -1,5 +1,5 @@
 from numpy.core import zeros, float64
-from numpy.testing import TestCase, assert_almost_equal
+from numpy.testing import dec, TestCase, assert_almost_equal, assert_
 from numpy.core.multiarray import inner as inner_
 
 DECPREC = 14
@@ -12,3 +12,17 @@
         a = zeros(shape = (1, 80), dtype = float64)
         p = inner_(a, a)
         assert_almost_equal(p, 0, decimal = DECPREC)
+
+try:
+    import numpy.core._dotblas as _dotblas
+except ImportError:
+    _dotblas = None
+
+@dec.skipif(_dotblas is None, "Numpy is not compiled with _dotblas")
+def test_blasdot_used():
+    from numpy.core import dot, vdot, inner, alterdot, restoredot
+    assert_(dot is _dotblas.dot)
+    assert_(vdot is _dotblas.vdot)
+    assert_(inner is _dotblas.inner)
+    assert_(alterdot is _dotblas.alterdot)
+    assert_(restoredot is _dotblas.restoredot)

Modified: branches/1.5.x/tools/py3tool.py
===================================================================
--- branches/1.5.x/tools/py3tool.py	2010-09-11 15:56:32 UTC (rev 8702)
+++ branches/1.5.x/tools/py3tool.py	2010-09-11 16:08:55 UTC (rev 8703)
@@ -157,7 +157,7 @@
         for mod in ['multiarray', 'scalarmath', 'umath', '_sort',
                     '_compiled_base', 'core', 'lib', 'testing', 'fft',
                     'polynomial', 'random', 'ma', 'linalg', 'compat',
-                    'mtrand']:
+                    'mtrand', '_dotblas']:
             text = re.sub(r'^(\s*)import %s' % mod,
                           r'\1from . import %s' % mod,
                           text, flags=re.M)



More information about the Numpy-svn mailing list