[python-bumps] 05/08: Fix test for numerical precision

Stuart Prescott stuart at debian.org
Sat Dec 30 05:47:58 UTC 2017


This is an automated email from the git hooks/post-receive script.

stuart pushed a commit to branch master
in repository python-bumps.

commit dfe6264c7b0e4c24a45e84c1370b562291f71037
Author: Stuart Prescott <stuart at debian.org>
Date:   Tue Dec 26 12:38:34 2017 +1100

    Fix test for numerical precision
---
 debian/patches/series               |  1 +
 debian/patches/test-precision.patch | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/debian/patches/series b/debian/patches/series
index f436b68..504be0b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 sphinx-local-mathjax.patch
+test-precision.patch
diff --git a/debian/patches/test-precision.patch b/debian/patches/test-precision.patch
new file mode 100644
index 0000000..1892c46
--- /dev/null
+++ b/debian/patches/test-precision.patch
@@ -0,0 +1,22 @@
+Description: Fix test for numerical fuzz on i386
+Author: Sturt Prescott <stuart at debian.org>
+Forwarded: https://github.com/bumps/bumps/pull/14
+--- a/bumps/wsolve.py
++++ b/bumps/wsolve.py
+@@ -420,6 +420,7 @@
+     """
+     Check that results are correct for a known problem.
+     """
++    from numpy.testing import assert_array_almost_equal_nulp
+     x = np.array([0, 1, 2, 3, 4], 'd')
+     y = np.array([2.5, 7.9, 13.9, 21.1, 44.4], 'd')
+     dy = np.array([1.7, 2.4, 3.6, 4.8, 6.2], 'd')
+@@ -444,7 +445,7 @@
+     assert dperr < 1e-14, "||dp-Tdp||=%g" % dperr
+     assert cierr < 1e-14, "||ci-Tci||=%g" % cierr
+     assert pierr < 1e-14, "||pi-Tpi||=%g" % pierr
+-    assert py == poly(px), "direct call to poly function fails"
++    assert_array_almost_equal_nulp(py, poly(px), nulp=8)
+ 
+ if __name__ == "__main__":
+ #    test()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/python-bumps.git



More information about the debian-science-commits mailing list