odd sign flip in angle test in `measurement_test.py`
On my system I'm seeing the following odd error in measurement_test.py
:
0$ PYTHONPATH=~/ligo/src/python-declarative:~/ligo/src/dtt2hdf pytest-3 test/measurement_test.py
============================================================== test session starts ===============================================================
platform linux -- Python 3.9.1+, pytest-6.0.2, py-1.10.0, pluggy-0.13.0
rootdir: /home/jrollins/ligo/src/calibration/pydarm
plugins: arraydiff-0.3, openfiles-0.5.0, hypothesis-5.43.3, cov-2.10.1, doctestplus-0.9.0, filter-subpackage-0.1.1, astropy-header-0.1.2, remotedata-0.3.2
collected 3 items
test/measurement_test.py F.. [100%]
==================================================================== FAILURES ====================================================================
______________________________________________________ TestGetRawTF.test_measurement_class _______________________________________________________
self = <test.measurement_test.TestGetRawTF testMethod=test_measurement_class>
def test_measurement_class(self):
for n in range(len(self.freq_from_dtt)):
self.assertAlmostEqual(self.freq_from_dtt[n],
self.freq_from_xml[n], places=4)
self.assertAlmostEqual(self.mag_from_dtt[n],
self.mag_from_xml[n], places=5)
> self.assertAlmostEqual(self.angle_from_dtt[n],
self.angle_from_xml[n], places=4)
E AssertionError: 128.63558380911294 != -128.63559 within 4 places (257.27117340872235 difference)
test/measurement_test.py:53: AssertionError
============================================================ short test summary info =============================================================
FAILED test/measurement_test.py::TestGetRawTF::test_measurement_class - AssertionError: 128.63558380911294 != -128.63559 within 4 places (257.2...
========================================================== 1 failed, 2 passed in 1.02s ===========================================================
1$
Why would the angle sign be flipped here? I have no idea.
I also note it may be nicer to do an actual array comparison rather than looping over values, maybe with numpy.allclose
.