[med-svn] [Git][med-team/python-cogent][master] 4 commits: More tolerant tests on i386 and armel (patches provided by upstream)

Andreas Tille gitlab at salsa.debian.org
Tue Feb 25 18:54:16 GMT 2020



Andreas Tille pushed to branch master at Debian Med / python-cogent


Commits:
5a08aa71 by Andreas Tille at 2020-02-25T16:39:46+01:00
More tolerant tests on i386 and armel (patches provided by upstream)

- - - - -
1b6213e5 by Andreas Tille at 2020-02-25T16:42:48+01:00
Patch does not apply - just ignored here

- - - - -
4e093643 by Andreas Tille at 2020-02-25T16:51:06+01:00
routine-update: Add salsa-ci file

- - - - -
b92f93b1 by Andreas Tille at 2020-02-25T19:51:57+01:00
Upload to unstable

- - - - -


5 changed files:

- debian/changelog
- + debian/patches/3bc0a8a413cb82ec6a3e86beaa0e2e71ad8ed3fb.patch
- + debian/patches/9ea740ee6a936895f68af59537fd6171803aa7e6.patch
- debian/patches/series
- + debian/salsa-ci.yml


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+python-cogent (2020.2.7a+dfsg-2) unstable; urgency=medium
+
+  * More tolerant tests on i386 and armel (patches provided by upstream)
+  * Add salsa-ci file (routine-update)
+
+ -- Andreas Tille <tille at debian.org>  Tue, 25 Feb 2020 16:51:08 +0100
+
 python-cogent (2020.2.7a+dfsg-1) unstable; urgency=medium
 
   * Solve one issue in test suite i386 / armel (other issue seems to be


=====================================
debian/patches/3bc0a8a413cb82ec6a3e86beaa0e2e71ad8ed3fb.patch
=====================================
@@ -0,0 +1,118 @@
+From 9ea740ee6a936895f68af59537fd6171803aa7e6 Mon Sep 17 00:00:00 2001
+From: Gavin Huttley <Gavin.Huttley at anu.edu.au>
+Date: Thu, 20 Feb 2020 08:25:55 +1100
+Bug-Debian: https://bugs.debian.org/950474
+Subject: [PATCH] TST: tweak the atol values for evaluating jsd/jsm cases that
+ produce 0, addresses #534
+Remark: Patch does not apply - just ignored here
+
+[CHANGED] the i386, armel CPUs have lower floating point precision. I've increased
+    the asbolute tolerance in the testing (for these functions only) to 4x machine
+    precision. This "may" fix the reported issue.
+---
+ tests/test_maths/test_measure.py | 20 +++++++++++++++++---
+ 1 file changed, 17 insertions(+), 3 deletions(-)
+
+diff --git a/tests/test_maths/test_measure.py b/tests/test_maths/test_measure.py
+index b2b64d81..f4c9f159 100644
+--- a/tests/test_maths/test_measure.py
++++ b/tests/test_maths/test_measure.py
+@@ -1,6 +1,6 @@
+ from unittest import TestCase, main
+ 
+-from numpy import diag_indices, dot
++from numpy import diag_indices, dot, finfo, float64
+ from numpy.random import random
+ from numpy.testing import assert_allclose
+ 
+@@ -111,6 +111,11 @@ def test_paralinear_continuous_time_validate(self):
+ 
+ 
+ class TestJensenShannon(TestCase):
++    # the following value is 4x machine precision, used to handle
++    # architectures that have lower precision and do not produce 0.0 from
++    # numerical calcs involved in jsd/jsm
++    atol = 4 * finfo(float64).eps
++
+     def test_jsd_validation(self):
+         """jsd fails with malformed data"""
+         freqs1 = random(5)
+@@ -164,7 +169,8 @@ def test_jsd_validation(self):
+             jsd(normalised_freqs1, freqs2, validate=True)  # invalid freqs2
+ 
+     def test_jsd(self):
+-        """case1 is testing if the jsd between two identical distributions is 0.0"""
++        """evaluate jsd between identical, and non-identical distributions"""
++        # case1 is testing if the jsd between two identical distributions is 0.0
+         case1 = [
+             [0.0, 0.0, 0.0],
+             [0.0, 0.0, 0.0],
+@@ -176,6 +182,7 @@ def test_jsd(self):
+                 jsd(case1[0], case1[1], validate=True),
+                 0.0,
+                 err_msg="Testing case1 for jsd failed",
++                atol=self.atol,
+             )
+             case1[0][index] = 0.0
+             case1[1][index] = 0.0
+@@ -185,6 +192,7 @@ def test_jsd(self):
+             jsd(case2[0], case2[1], validate=True),
+             0.7655022032053593,
+             err_msg="Testing case2 for jsd failed",
++            atol=self.atol,
+         )
+         # case3 is testing the numerical output of jsd between two distant distributions
+         case3 = [[1.0, 0.0], [1 / 2, 1 / 2]]
+@@ -192,6 +200,7 @@ def test_jsd(self):
+             jsd(case3[0], case3[1], validate=True),
+             0.3112781244591328,
+             err_msg="Testing case3 for jsd failed",
++            atol=self.atol,
+         )
+         # case4 - the jsd between two identical uniform distributions is 0.0
+         case4 = [
+@@ -202,10 +211,11 @@ def test_jsd(self):
+             jsd(case4[0], case4[1], validate=True),
+             0.0,
+             err_msg="Testing case4 for jsd failed",
++            atol=self.atol,
+         )
+ 
+     def test_jsm(self):
+-        """case1 is testing if the jsm between two identical distributions is 0.0"""
++        """evaluate jsm between identical, and non-identical distributions"""
+         case1 = [
+             [0.0, 0.0, 0.0],
+             [0.0, 0.0, 0.0],
+@@ -217,6 +227,7 @@ def test_jsm(self):
+                 jsm(case1[0], case1[1], validate=True),
+                 0.0,
+                 err_msg="Testing case1 for jsm failed",
++                atol=self.atol,
+             )
+             case1[0][index] = 0.0
+             case1[1][index] = 0.0
+@@ -226,6 +237,7 @@ def test_jsm(self):
+             jsm(case2[0], case2[1], validate=True),
+             0.8749298275892526,
+             err_msg="Testing case2 for jsm failed",
++            atol=self.atol,
+         )
+         # case3 is testing the numerical output of jsm between two random distributions
+         case3 = [[1.0, 0.0], [1 / 2, 1 / 2]]
+@@ -233,6 +245,7 @@ def test_jsm(self):
+             jsm(case3[0], case3[1], validate=True),
+             0.5579230452841438,
+             err_msg="Testing case3 for jsm failed",
++            atol=self.atol,
+         )
+         # case4 is testing if the jsm between two identical uniform distributions is 0.0
+         case4 = [
+@@ -243,6 +256,7 @@ def test_jsm(self):
+             jsm(case4[0], case4[1], validate=True),
+             0.0,
+             err_msg="Testing case4 for jsm failed",
++            atol=self.atol,
+         )
+ 
+ 


=====================================
debian/patches/9ea740ee6a936895f68af59537fd6171803aa7e6.patch
=====================================
@@ -0,0 +1,117 @@
+From 9ea740ee6a936895f68af59537fd6171803aa7e6 Mon Sep 17 00:00:00 2001
+From: Gavin Huttley <Gavin.Huttley at anu.edu.au>
+Date: Thu, 20 Feb 2020 08:25:55 +1100
+Bug-Debian: https://bugs.debian.org/950474
+Subject: [PATCH] TST: tweak the atol values for evaluating jsd/jsm cases that
+ produce 0, addresses #534
+
+[CHANGED] the i386, armel CPUs have lower floating point precision. I've increased
+    the asbolute tolerance in the testing (for these functions only) to 4x machine
+    precision. This "may" fix the reported issue.
+---
+ tests/test_maths/test_measure.py | 20 +++++++++++++++++---
+ 1 file changed, 17 insertions(+), 3 deletions(-)
+
+diff --git a/tests/test_maths/test_measure.py b/tests/test_maths/test_measure.py
+index b2b64d81..f4c9f159 100644
+--- a/tests/test_maths/test_measure.py
++++ b/tests/test_maths/test_measure.py
+@@ -1,6 +1,6 @@
+ from unittest import TestCase, main
+ 
+-from numpy import diag_indices, dot
++from numpy import diag_indices, dot, finfo, float64
+ from numpy.random import random
+ from numpy.testing import assert_allclose
+ 
+@@ -111,6 +111,11 @@ def test_paralinear_continuous_time_validate(self):
+ 
+ 
+ class TestJensenShannon(TestCase):
++    # the following value is 4x machine precision, used to handle
++    # architectures that have lower precision and do not produce 0.0 from
++    # numerical calcs involved in jsd/jsm
++    atol = 4 * finfo(float64).eps
++
+     def test_jsd_validation(self):
+         """jsd fails with malformed data"""
+         freqs1 = random(5)
+@@ -164,7 +169,8 @@ def test_jsd_validation(self):
+             jsd(normalised_freqs1, freqs2, validate=True)  # invalid freqs2
+ 
+     def test_jsd(self):
+-        """case1 is testing if the jsd between two identical distributions is 0.0"""
++        """evaluate jsd between identical, and non-identical distributions"""
++        # case1 is testing if the jsd between two identical distributions is 0.0
+         case1 = [
+             [0.0, 0.0, 0.0],
+             [0.0, 0.0, 0.0],
+@@ -176,6 +182,7 @@ def test_jsd(self):
+                 jsd(case1[0], case1[1], validate=True),
+                 0.0,
+                 err_msg="Testing case1 for jsd failed",
++                atol=self.atol,
+             )
+             case1[0][index] = 0.0
+             case1[1][index] = 0.0
+@@ -185,6 +192,7 @@ def test_jsd(self):
+             jsd(case2[0], case2[1], validate=True),
+             0.7655022032053593,
+             err_msg="Testing case2 for jsd failed",
++            atol=self.atol,
+         )
+         # case3 is testing the numerical output of jsd between two distant distributions
+         case3 = [[1.0, 0.0], [1 / 2, 1 / 2]]
+@@ -192,6 +200,7 @@ def test_jsd(self):
+             jsd(case3[0], case3[1], validate=True),
+             0.3112781244591328,
+             err_msg="Testing case3 for jsd failed",
++            atol=self.atol,
+         )
+         # case4 - the jsd between two identical uniform distributions is 0.0
+         case4 = [
+@@ -202,10 +211,11 @@ def test_jsd(self):
+             jsd(case4[0], case4[1], validate=True),
+             0.0,
+             err_msg="Testing case4 for jsd failed",
++            atol=self.atol,
+         )
+ 
+     def test_jsm(self):
+-        """case1 is testing if the jsm between two identical distributions is 0.0"""
++        """evaluate jsm between identical, and non-identical distributions"""
+         case1 = [
+             [0.0, 0.0, 0.0],
+             [0.0, 0.0, 0.0],
+@@ -217,6 +227,7 @@ def test_jsm(self):
+                 jsm(case1[0], case1[1], validate=True),
+                 0.0,
+                 err_msg="Testing case1 for jsm failed",
++                atol=self.atol,
+             )
+             case1[0][index] = 0.0
+             case1[1][index] = 0.0
+@@ -226,6 +237,7 @@ def test_jsm(self):
+             jsm(case2[0], case2[1], validate=True),
+             0.8749298275892526,
+             err_msg="Testing case2 for jsm failed",
++            atol=self.atol,
+         )
+         # case3 is testing the numerical output of jsm between two random distributions
+         case3 = [[1.0, 0.0], [1 / 2, 1 / 2]]
+@@ -233,6 +245,7 @@ def test_jsm(self):
+             jsm(case3[0], case3[1], validate=True),
+             0.5579230452841438,
+             err_msg="Testing case3 for jsm failed",
++            atol=self.atol,
+         )
+         # case4 is testing if the jsm between two identical uniform distributions is 0.0
+         case4 = [
+@@ -243,6 +256,7 @@ def test_jsm(self):
+             jsm(case4[0], case4[1], validate=True),
+             0.0,
+             err_msg="Testing case4 for jsm failed",
++            atol=self.atol,
+         )
+ 
+ 


=====================================
debian/patches/series
=====================================
@@ -1,3 +1,5 @@
 sphinx.patch
 fix_interpreter.patch
 96ab670d76f88a188286017602c1c47463be5037.patch
+9ea740ee6a936895f68af59537fd6171803aa7e6.patch
+# 3bc0a8a413cb82ec6a3e86beaa0e2e71ad8ed3fb.patch


=====================================
debian/salsa-ci.yml
=====================================
@@ -0,0 +1,4 @@
+---
+include:
+  - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
+  - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml



View it on GitLab: https://salsa.debian.org/med-team/python-cogent/-/compare/79f8f0c02b7274895792e150fd99403bfe2df308...b92f93b10ea3f06f3845d2a706e3508e9441632c

-- 
View it on GitLab: https://salsa.debian.org/med-team/python-cogent/-/compare/79f8f0c02b7274895792e150fd99403bfe2df308...b92f93b10ea3f06f3845d2a706e3508e9441632c
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20200225/68f9550b/attachment-0001.html>


More information about the debian-med-commit mailing list