[Numpy-svn] r8699 - in trunk: numpy/core/tests tools

numpy-svn@scip... numpy-svn@scip...
Sat Sep 11 09:52:07 CDT 2010


Author: ptvirtan
Date: 2010-09-11 09:52:07 -0500 (Sat, 11 Sep 2010)
New Revision: 8699

Modified:
   trunk/numpy/core/tests/test_blasdot.py
   trunk/tools/py3tool.py
Log:
BUG: core: fix _dotblas usage on Py3 (fixes #1609)

Modified: trunk/numpy/core/tests/test_blasdot.py
===================================================================
--- trunk/numpy/core/tests/test_blasdot.py	2010-09-07 12:58:57 UTC (rev 8698)
+++ trunk/numpy/core/tests/test_blasdot.py	2010-09-11 14:52:07 UTC (rev 8699)
@@ -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: trunk/tools/py3tool.py
===================================================================
--- trunk/tools/py3tool.py	2010-09-07 12:58:57 UTC (rev 8698)
+++ trunk/tools/py3tool.py	2010-09-11 14:52:07 UTC (rev 8699)
@@ -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