File: scipy1.14.patch

package info (click to toggle)
python-questplus 2023.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 320 kB
  • sloc: python: 1,345; makefile: 18
file content (23 lines) | stat: -rw-r--r-- 1,037 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
Description: Allow more rounding errors in the tests with scipy 1.14
Bug: https://github.com/hoechenberger/questplus/issues/55
Bug-Debian: https://bugs.debian.org/1079788
Author: Graham Inggs <ginggs@debian.org>
Last-Update: 2024-12-19

--- a/questplus/tests/test_qp.py
+++ b/questplus/tests/test_qp.py
@@ -435,11 +435,11 @@
         next_stim_1 =  qp.next_stim['physical_magnitude_stim_1']
         next_stim_2 =  qp.next_stim['physical_magnitude_stim_2']
 
-        if trial_idx in (6, 20):
+        if trial_idx in (6, 20, 21):
             # Rounding errors make the algorithm behave differently on different platforms.
             if (
-                expected_stim_1 == next_stim_2 and
-                expected_stim_2 == next_stim_1
+                np.isclose(expected_stim_1, next_stim_2) and
+                np.isclose(expected_stim_2, next_stim_1)
             ):
                 expected_stim_1, expected_stim_2 = expected_stim_2, expected_stim_1
                 response = 'First' if response == 'Second' else 'Second'