[Python-modules-commits] r24314 - in packages/scipy/trunk/debian (3 files)
jtaylor-guest at users.alioth.debian.org
jtaylor-guest at users.alioth.debian.org
Sat May 11 19:25:27 UTC 2013
Date: Saturday, May 11, 2013 @ 19:25:25
Author: jtaylor-guest
Revision: 24314
cap-ld-precision.patch: fix test failures due to broken np.finfo on ppc
Added:
packages/scipy/trunk/debian/patches/cap-ld-precision.patch
Modified:
packages/scipy/trunk/debian/changelog
packages/scipy/trunk/debian/patches/series
Modified: packages/scipy/trunk/debian/changelog
===================================================================
--- packages/scipy/trunk/debian/changelog 2013-05-11 19:25:21 UTC (rev 24313)
+++ packages/scipy/trunk/debian/changelog 2013-05-11 19:25:25 UTC (rev 24314)
@@ -11,6 +11,7 @@
reswigging from setup.py, dropped from debian/rules
* cython-wraparound.patch: fix issue in ckdtree.pyx
* qhull-lfs.patch: enable large file support
+ * cap-ld-precision.patch: fix test failures due to broken np.finfo on ppc
* refresh patches and remove upstream applied:
- BUG-fix-dependency-on-dict-ordering-in-test.patch
- BUG-remove-inline-statement-rejected-by-cython.patch
Added: packages/scipy/trunk/debian/patches/cap-ld-precision.patch
===================================================================
--- packages/scipy/trunk/debian/patches/cap-ld-precision.patch (rev 0)
+++ packages/scipy/trunk/debian/patches/cap-ld-precision.patch 2013-05-11 19:25:25 UTC (rev 24314)
@@ -0,0 +1,50 @@
+Description: cap the decimal precision
+ np.finfo returns 75 or nonconvergence RuntimeError on ppc
+Author: Julian Taylor <jtaylor.debian at googlemail.com>
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=702169
+
+--- a/scipy/signal/tests/test_signaltools.py
++++ b/scipy/signal/tests/test_signaltools.py
+@@ -609,7 +609,15 @@ class TestCorrelate2d(TestCase):
+ # name will be TestCorrelateComplex###, where ### is the number of bits.
+ for datatype in [np.csingle, np.cdouble, np.clongdouble]:
+ cls = _get_testcorrelate_class(datatype, _TestCorrelateComplex)
+- cls.decimal = int(2 * np.finfo(datatype).precision / 3)
++ # will either return a too large value for longdouble
++ # or nonconvergence RuntimeError see #702169
++ try:
++ cls.decimal = int(2 * np.finfo(datatype).precision / 3)
++ if cls.decimal > 25:
++ cls.decimal = 14
++ except RuntimeError:
++ cls.decimal = 14
++
+ globals()[cls.__name__] = cls
+--- a/scipy/linalg/tests/test_basic.py
++++ b/scipy/linalg/tests/test_basic.py
+@@ -674,13 +674,23 @@ class TestNorm(object):
+ def test_types(self):
+ for dtype in np.typecodes['AllFloat']:
+ x = np.array([1,2,3], dtype=dtype)
+- tol = max(1e-15, np.finfo(dtype).eps.real * 20)
++ # does not converge on ppc for float128
++ try:
++ eps = np.finfo(dtype).eps.real
++ except RuntimeError:
++ eps = 1e-19
++ tol = max(1e-15, eps * 20)
+ assert_allclose(norm(x), np.sqrt(14), rtol=tol)
+ assert_allclose(norm(x, 2), np.sqrt(14), rtol=tol)
+
+ for dtype in np.typecodes['Complex']:
+ x = np.array([1j,2j,3j], dtype=dtype)
+- tol = max(1e-15, np.finfo(dtype).eps.real * 20)
++ # does not converge on ppc for float128
++ try:
++ eps = np.finfo(dtype).eps.real
++ except RuntimeError:
++ eps = 1e-19
++ tol = max(1e-15, eps * 20)
+ assert_allclose(norm(x), np.sqrt(14), rtol=tol)
+ assert_allclose(norm(x, 2), np.sqrt(14), rtol=tol)
+
Modified: packages/scipy/trunk/debian/patches/series
===================================================================
--- packages/scipy/trunk/debian/patches/series 2013-05-11 19:25:21 UTC (rev 24313)
+++ packages/scipy/trunk/debian/patches/series 2013-05-11 19:25:25 UTC (rev 24314)
@@ -4,3 +4,4 @@
reswig.patch
cython-wraparound.patch
qhull-lfs.patch
+cap-ld-precision.patch
More information about the Python-modules-commits
mailing list