sot / find_attitude

Find the attitude of Chandra from ACA yag/zag positions (full-sky search)
https://sot.github.io/find_attitude
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Update test to pass with agasc 1p8 present #29

Closed jeanconn closed 4 months ago

jeanconn commented 4 months ago

Description

Pin a test at 1p7 and set rest for agasc1p8 via rc

Fixes test not passing with agasc 1p8.

Interface impacts

Testing

Unit tests

jeanconn-fido> git rev-parse HEAD
677dc69c74117502baf8aa3e1a08e372d559637c
jeanconn-fido> pytest --pdb
================================================================== test session starts ==================================================================
platform linux -- Python 3.11.8, pytest-7.4.4, pluggy-1.4.0
rootdir: /proj/sot/ska/jeanproj/git
configfile: pytest.ini
plugins: anyio-4.3.0, timeout-2.2.0
collected 6 items                                                                                                                                       

find_attitude/tests/test_find_attitude.py .....4s.                                                                                                  [100%]

============================================================= 6 passed in 158.32s (0:02:38) =============================================================
jeanconn-fido> export AGASC_DIR=/proj/sot/ska/data/agasc/rc
jeanconn-fido> pytest --pdb
================================================================== test session starts ==================================================================
platform linux -- Python 3.11.8, pytest-7.4.4, pluggy-1.4.0
rootdir: /proj/sot/ska/jeanproj/git
configfile: pytest.ini
plugins: anyio-4.3.0, timeout-2.2.0
collected 6 items                                                                                                                                       

find_attitude/tests/test_find_attitude.py ......                                                                                                  [100%]

============================================================= 6 passed in 152.31s (0:02:32

Independent check of unit tests by [REVIEWER NAME]

Functional tests

No functional testing.

jeanconn commented 4 months ago

@taldcroft You'd mentioned from your review that find_attitude would be fine for operational use with AGASC 1.8 in use but the distances file still built with 1.7. I think that this test failure when AGASC 1.8 was in use on this one test just speaks to a specific use case of doing a matching check that uses the ids in the distances file (in a way we don't for operational use). But not sure what functional testing you had in mind for find_attitude or if you wanted to update the distances file in advance of 1.8 promotion anyway.

taldcroft commented 4 months ago

After much head scratching, I finally understood that the test is failing due to two nearby stars 1230122672 and 1230121896. They are separated by about half-arcsec and 5.6 and 6.6 mag respectively. The head scratching was because that test failure was not quite reproducible, depending on the seed and other circumstances. What was happening is that sometimes it would get the wrong one of the pair due to the random variation in observed star yag/zag.

Upshot is that this PR should be closed in favor of #30.

jeanconn commented 4 months ago

Ah. I did not know that the test sometimes passed with 1.8 so assumed it was a 1.7 issue.