test_stack_measurements test fails with numpy >= 1.25
Summary
The TestSensingStackMeasurementsGPR.test_stack_measurements
test fails in an environment including numpy >= 1.25.0
:
______________________ TestSensingStackMeasurementsGPR.test_stack_measurements _______________________
self = <test.test_measurement.TestSensingStackMeasurementsGPR testMethod=test_stack_measurements>
def test_stack_measurements(self):
test, test_kappas = self.meas.stack_measurements(
[self.meas2], 20, 5000, [20], [5000])
for n in range(len(test[0][0])):
self.assertAlmostEqual(test[0][0][n] / self.known_freq[n], 1.0)
self.assertAlmostEqual(
np.abs(test[0][2][n])/np.abs(self.known_opt_resp[n]), 1.0, places=6)
> self.assertAlmostEqual(
np.abs(np.angle(test[0][2][n], deg=True) -
np.angle(self.known_opt_resp[n], deg=True)),
0.0, places=6)
E AssertionError: 1.6637319131262984e-06 != 0.0 within 6 places (1.6637319131262984e-06 difference)
test/test_measurement.py:1002: AssertionError
Steps to reproduce
mamba create -n test -c conda-forge -y python=3.11 numpy=1.25 pydarm pytest
conda activate test
cd ~/git/pydarm
git checkout master && git pull
python3 -m pytest test/