diff -Nru python-cogent-2020.2.7a+dfsg/debian/changelog python-cogent-2020.2.7a+dfsg/debian/changelog --- python-cogent-2020.2.7a+dfsg/debian/changelog 2020-02-17 19:00:55.000000000 +0000 +++ python-cogent-2020.2.7a+dfsg/debian/changelog 2020-02-25 15:51:08.000000000 +0000 @@ -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 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 diff -Nru python-cogent-2020.2.7a+dfsg/debian/patches/3bc0a8a413cb82ec6a3e86beaa0e2e71ad8ed3fb.patch python-cogent-2020.2.7a+dfsg/debian/patches/3bc0a8a413cb82ec6a3e86beaa0e2e71ad8ed3fb.patch --- python-cogent-2020.2.7a+dfsg/debian/patches/3bc0a8a413cb82ec6a3e86beaa0e2e71ad8ed3fb.patch 1970-01-01 00:00:00.000000000 +0000 +++ python-cogent-2020.2.7a+dfsg/debian/patches/3bc0a8a413cb82ec6a3e86beaa0e2e71ad8ed3fb.patch 2020-02-25 15:51:08.000000000 +0000 @@ -0,0 +1,118 @@ +From 9ea740ee6a936895f68af59537fd6171803aa7e6 Mon Sep 17 00:00:00 2001 +From: Gavin Huttley +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, + ) + + diff -Nru python-cogent-2020.2.7a+dfsg/debian/patches/9ea740ee6a936895f68af59537fd6171803aa7e6.patch python-cogent-2020.2.7a+dfsg/debian/patches/9ea740ee6a936895f68af59537fd6171803aa7e6.patch --- python-cogent-2020.2.7a+dfsg/debian/patches/9ea740ee6a936895f68af59537fd6171803aa7e6.patch 1970-01-01 00:00:00.000000000 +0000 +++ python-cogent-2020.2.7a+dfsg/debian/patches/9ea740ee6a936895f68af59537fd6171803aa7e6.patch 2020-02-25 15:51:08.000000000 +0000 @@ -0,0 +1,117 @@ +From 9ea740ee6a936895f68af59537fd6171803aa7e6 Mon Sep 17 00:00:00 2001 +From: Gavin Huttley +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, + ) + + diff -Nru python-cogent-2020.2.7a+dfsg/debian/patches/series python-cogent-2020.2.7a+dfsg/debian/patches/series --- python-cogent-2020.2.7a+dfsg/debian/patches/series 2020-02-17 19:00:55.000000000 +0000 +++ python-cogent-2020.2.7a+dfsg/debian/patches/series 2020-02-25 15:51:08.000000000 +0000 @@ -1,3 +1,5 @@ sphinx.patch fix_interpreter.patch 96ab670d76f88a188286017602c1c47463be5037.patch +9ea740ee6a936895f68af59537fd6171803aa7e6.patch +# 3bc0a8a413cb82ec6a3e86beaa0e2e71ad8ed3fb.patch diff -Nru python-cogent-2020.2.7a+dfsg/debian/salsa-ci.yml python-cogent-2020.2.7a+dfsg/debian/salsa-ci.yml --- python-cogent-2020.2.7a+dfsg/debian/salsa-ci.yml 1970-01-01 00:00:00.000000000 +0000 +++ python-cogent-2020.2.7a+dfsg/debian/salsa-ci.yml 2020-02-25 15:51:08.000000000 +0000 @@ -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