Merge ~zhsj/ubuntu/+source/abydos:bug2045121 into ubuntu/+source/abydos:ubuntu/devel

Proposed by Shengjing Zhu
Status: Merged
Merge reported by: Robie Basak
Merged at revision: aa88ee8176a958cfe5e6d0620667527b2c52b997
Proposed branch: ~zhsj/ubuntu/+source/abydos:bug2045121
Merge into: ubuntu/+source/abydos:ubuntu/devel
Diff against target: 96 lines (+62/-1)
4 files modified
debian/changelog (+7/-0)
debian/control (+2/-1)
debian/patches/series (+1/-0)
debian/patches/use-assertAlmostEqual-to-compare-float-number-in-pairwise.patch (+52/-0)
Reviewer Review Type Date Requested Status
Benjamin Drung (community) Approve
Review via email: mp+456583@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Shengjing Zhu (zhsj) wrote :

PPA: https://launchpad.net/~zhsj/+archive/ubuntu/bug2045121

autopkgtest result https://autopkgtest.ubuntu.com/results/autopkgtest-noble-zhsj-bug2045121/noble/amd64/a/abydos/20231130_100301_7290a@/log.gz

571s autopkgtest [10:02:45]: test pytest: -----------------------]
571s autopkgtest [10:02:45]: test pytest: - - - - - - - - - - results - - - - - - - - - -
571s pytest PASS
571s autopkgtest [10:02:45]: @@@@@@@@@@@@@@@@@@@@ summary
571s pytest PASS

Revision history for this message
Benjamin Drung (bdrung) wrote :

I'll sponsor it via Debian.

Revision history for this message
Benjamin Drung (bdrung) wrote :

Uploaded abydos 0.5.0+git20201231.344346a-7 to Debian unstable and it will be auto-synced. So this MR can be closed.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index c55029f..a47ba66 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+abydos (0.5.0+git20201231.344346a-6ubuntu1) noble; urgency=medium
7+
8+ * Fix comparing float number in pairwise tests on Python 3.12 (LP: #2045121)
9+ + Add debian/patches/use-assertAlmostEqual-to-compare-float-number-in-pairwise.patch
10+
11+ -- Shengjing Zhu <shengjing.zhu@canonical.com> Thu, 30 Nov 2023 16:24:38 +0800
12+
13 abydos (0.5.0+git20201231.344346a-6) unstable; urgency=medium
14
15 * Fix failing test script: assertEqual should be replaced by
16diff --git a/debian/control b/debian/control
17index 55c3af8..5bd671f 100644
18--- a/debian/control
19+++ b/debian/control
20@@ -1,7 +1,8 @@
21 Source: abydos
22 Section: python
23 Priority: optional
24-Maintainer: Debian Python Team <team+python@tracker.debian.org>
25+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
26+XSBC-Original-Maintainer: Debian Python Team <team+python@tracker.debian.org>
27 Uploaders: Julian Gilbey <jdg@debian.org>
28 Build-Depends: debhelper-compat (= 13),
29 dh-sequence-python3,
30diff --git a/debian/patches/series b/debian/patches/series
31index 7a3f657..2998291 100644
32--- a/debian/patches/series
33+++ b/debian/patches/series
34@@ -5,3 +5,4 @@ fix-lualatex-build.patch
35 fix-newer-sphinxcontrib-bibtex.patch
36 fix-mathjax-path.patch
37 assert-equal-failures.patch
38+use-assertAlmostEqual-to-compare-float-number-in-pairwise.patch
39diff --git a/debian/patches/use-assertAlmostEqual-to-compare-float-number-in-pairwise.patch b/debian/patches/use-assertAlmostEqual-to-compare-float-number-in-pairwise.patch
40new file mode 100644
41index 0000000..067dcaf
42--- /dev/null
43+++ b/debian/patches/use-assertAlmostEqual-to-compare-float-number-in-pairwise.patch
44@@ -0,0 +1,52 @@
45+From: Shengjing Zhu <shengjing.zhu@canonical.com>
46+Date: Thu, 30 Nov 2023 16:19:36 +0800
47+Subject: use assertAlmostEqual to compare float number in pairwise tests
48+
49+---
50+ tests/stats/test_stats_pairwise.py | 16 ++++++++--------
51+ 1 file changed, 8 insertions(+), 8 deletions(-)
52+
53+diff --git a/tests/stats/test_stats_pairwise.py b/tests/stats/test_stats_pairwise.py
54+index 376569d..91e5ba3 100644
55+--- a/tests/stats/test_stats_pairwise.py
56++++ b/tests/stats/test_stats_pairwise.py
57+@@ -75,31 +75,31 @@ class MPSTestCases(unittest.TestCase):
58+
59+ def test_mean_pairwise_similarity(self):
60+ """Test abydos.stats.mean_pairwise_similarity."""
61+- self.assertEqual(mean_pairwise_similarity(NIALL), 0.29362587170180671)
62+- self.assertEqual(
63++ self.assertAlmostEqual(mean_pairwise_similarity(NIALL), 0.29362587170180671)
64++ self.assertAlmostEqual(
65+ mean_pairwise_similarity(NIALL, symmetric=True), 0.2936258717018066
66+ )
67+- self.assertEqual(
68++ self.assertAlmostEqual(
69+ mean_pairwise_similarity(NIALL, mean_func=hmean),
70+ 0.29362587170180671,
71+ )
72+- self.assertEqual(
73++ self.assertAlmostEqual(
74+ mean_pairwise_similarity(NIALL, mean_func=hmean, symmetric=True),
75+ 0.2936258717018066,
76+ )
77+- self.assertEqual(
78++ self.assertAlmostEqual(
79+ mean_pairwise_similarity(NIALL, mean_func=gmean),
80+ 0.33747245800668441,
81+ )
82+- self.assertEqual(
83++ self.assertAlmostEqual(
84+ mean_pairwise_similarity(NIALL, mean_func=gmean, symmetric=True),
85+ 0.33747245800668441,
86+ )
87+- self.assertEqual(
88++ self.assertAlmostEqual(
89+ mean_pairwise_similarity(NIALL, mean_func=amean),
90+ 0.38009278711484601,
91+ )
92+- self.assertEqual(
93++ self.assertAlmostEqual(
94+ mean_pairwise_similarity(NIALL, mean_func=amean, symmetric=True),
95+ 0.38009278711484623,
96+ )

Subscribers

People subscribed via source and target branches