File: 0001-Fix-floating-point-comparison.patch

package info (click to toggle)
python-ltfatpy 1.1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 41,412 kB
  • sloc: ansic: 8,546; python: 6,470; makefile: 15
file content (23 lines) | stat: -rw-r--r-- 989 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
From: Antonio Valentino <antonio.valentino@tiscali.it>
Date: Thu, 22 Dec 2022 13:43:09 +0000
Subject: Fix floating point comparison

---
 ltfatpy/tests/gabor/test_gabphasegrad.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ltfatpy/tests/gabor/test_gabphasegrad.py b/ltfatpy/tests/gabor/test_gabphasegrad.py
index 5c585bb..dc6eb19 100644
--- a/ltfatpy/tests/gabor/test_gabphasegrad.py
+++ b/ltfatpy/tests/gabor/test_gabphasegrad.py
@@ -161,8 +161,8 @@ class TestGabphasegrad(unittest.TestCase):
                     g = str(g)
                 tgrad, fgrad = gabphasegrad(method, s, g, a, **kwargs)
                 msg = 'wrong output in gabphasegrad with inputs ' + str(inputs)
-                assert_array_equal(tgrad, outputs[0], msg)
-                assert_array_equal(fgrad, outputs[1], msg)
+                assert_allclose(tgrad, outputs[0], err_msg=msg)
+                assert_allclose(fgrad, outputs[1], err_msg=msg)
 
 
 if __name__ == '__main__':