[Debian-med-packaging] Bug#1079788: python-questplus: test_thurstone_scaling fails on arm64 with scipy 1.14

Drew Parsons dparsons at debian.org
Tue Aug 27 12:47:31 BST 2024


Source: python-questplus
Version: 2023.1-2
Severity: normal

python-questplus is failing tests on arm64 with scipy 1.14 (from
experimental)

 71s ____________________________ test_thurstone_scaling ____________________________
 71s 
 71s     def test_thurstone_scaling():
 71s         """
 71s         Watson 2017, Example 6:
 71s         "Thurstone scaling {2, 3, 2}"
 71s         """
 71s         stim_magnitudes = np.arange(0, 1+0.1, 0.1)
 71s         perceptual_scale_maxs = np.arange(1, 10+1)
 71s         thresholds = np.arange(0, 0.9+0.1, 0.1)
 71s         powers = np.arange(0.1, 1+0.1, 0.1)
 71s     
 71s         # Due to differences in rounding, the order of stimuli (1 or 2) is swapped on some trials
 71s         # compared to the paper. We therefore have to swap the example response as well.
 71s         #
 71s         # We're only testing the first 22 trials here.
 71s         responses = ['Second'] * 6
 71s         responses.extend(['Second'])       # rounding difference
 71s         responses.extend(['Second'] * 13)
 71s         responses.extend(['Second'])       # rounding difference
 71s         responses.extend(['First'])
 71s     
 71s         expected_stims = [
 71s             {'physical_magnitude_stim_1': 0.0, 'physical_magnitude_stim_2': 0.7},
 71s             {'physical_magnitude_stim_1': 0.0, 'physical_magnitude_stim_2': 0.6},
 71s             {'physical_magnitude_stim_1': 0.0, 'physical_magnitude_stim_2': 0.5},
 71s             {'physical_magnitude_stim_1': 0.0, 'physical_magnitude_stim_2': 0.4},
 71s             {'physical_magnitude_stim_1': 0.0, 'physical_magnitude_stim_2': 0.3},
 71s             {'physical_magnitude_stim_1': 0.0, 'physical_magnitude_stim_2': 0.3},
 71s             {'physical_magnitude_stim_1': 0.2, 'physical_magnitude_stim_2': 0.0},
 71s             {'physical_magnitude_stim_1': 0.0, 'physical_magnitude_stim_2': 0.4},
 71s             {'physical_magnitude_stim_1': 0.0, 'physical_magnitude_stim_2': 0.3},
 71s             {'physical_magnitude_stim_1': 0.2, 'physical_magnitude_stim_2': 0.3},
 71s             {'physical_magnitude_stim_1': 0.2, 'physical_magnitude_stim_2': 0.3},
 71s             {'physical_magnitude_stim_1': 0.2, 'physical_magnitude_stim_2': 0.3},
 71s             {'physical_magnitude_stim_1': 0.2, 'physical_magnitude_stim_2': 0.3},
 71s             {'physical_magnitude_stim_1': 0.5, 'physical_magnitude_stim_2': 1.0},
 71s             {'physical_magnitude_stim_1': 0.2, 'physical_magnitude_stim_2': 0.3},
 71s             {'physical_magnitude_stim_1': 0.5, 'physical_magnitude_stim_2': 1.0},
 71s             {'physical_magnitude_stim_1': 0.5, 'physical_magnitude_stim_2': 1.0},
 71s             {'physical_magnitude_stim_1': 0.2, 'physical_magnitude_stim_2': 0.3},
 71s             {'physical_magnitude_stim_1': 0.5, 'physical_magnitude_stim_2': 1.0},
 71s             {'physical_magnitude_stim_1': 0.6, 'physical_magnitude_stim_2': 1.0},
 71s             {'physical_magnitude_stim_1': 0.2, 'physical_magnitude_stim_2': 0.3},
 71s             {'physical_magnitude_stim_1': 0.6, 'physical_magnitude_stim_2': 1.0},
 71s         ]
 71s     
 71s         qp = QuestPlusThurstone(
 71s             physical_magnitudes_stim_1=stim_magnitudes,
 71s             physical_magnitudes_stim_2=stim_magnitudes,
 71s             thresholds=thresholds,
 71s             powers=powers,
 71s             perceptual_scale_maxs=perceptual_scale_maxs
 71s         )
 71s     
 71s         for trial_idx, x in enumerate(zip(expected_stims, responses)):
 71s             expected_stim, response = x
 71s     
 71s             expected_stim_1 = expected_stim['physical_magnitude_stim_1']
 71s             expected_stim_2 = expected_stim['physical_magnitude_stim_2']
 71s     
 71s             next_stim_1 =  qp.next_stim['physical_magnitude_stim_1']
 71s             next_stim_2 =  qp.next_stim['physical_magnitude_stim_2']
 71s     
 71s             if trial_idx in (6, 20):
 71s                 # Rounding errors make the algorithm behave differently on different platforms.
 71s                 if (
 71s                     expected_stim_1 == next_stim_2 and
 71s                     expected_stim_2 == next_stim_1
 71s                 ):
 71s                     expected_stim_1, expected_stim_2 = expected_stim_2, expected_stim_1
 71s                     response = 'First' if response == 'Second' else 'Second'
 71s     
 71s >           assert np.isclose(next_stim_1, expected_stim_1)
 71s E           assert False
 71s E            +  where False = <function isclose at 0xffffb425d470>(1.0, 0.6)
 71s E            +    where <function isclose at 0xffffb425d470> = np.isclose
 71s 
 71s questplus/test_qp.py:447: AssertionError


Full test log at
https://ci.debian.net/packages/p/python-questplus/unstable/arm64/51054054/



More information about the Debian-med-packaging mailing list