This is to factor out the sparkles checks from being ACAReviewTable methods to independent check functions that return a list of messages. The motivation is to decouple these catalog checks from sparkles and make it easier to run them from starcheck or elsewhere.
Key updates:
Move checks from being methods of the ACAReviewTable class into functions in a new checks.py module.
The functions take arbitrary arguments and return list[Message].
In the existing sparkles checks the first argument is always an ACACheckTable or subclass, but that is no longer a requirement.
Future checks should be written with more specific arguments where that would make sense.
New Message dataclass and move MessagesList into new messages.py module.
Factor out a new ACACheckTable class that provides the minimal functionality to perform checks. This separates out all the sparkles review functionality (making reports, roll angle optimization, etc) from the basic catalog checking functionality:
messages attribute to capture messages
Additional columns like row and col etc to facilitate checking the catalog
Some helper attributes.
Update check tests to use both ACAReviewTable and ACACheckTable.
The refactoring part is going to be difficult for code review but the tests are solid.
===================================================== 103 passed in 34.39s =====================================================
Independent check of unit tests by Jean
- [x] Linux
### Functional tests
<!-- Describe and document results of any functional tests, otherwise leave the text below -->
No functional testing.
Description
This is to factor out the sparkles checks from being
ACAReviewTable
methods to independent check functions that return a list of messages. The motivation is to decouple these catalog checks from sparkles and make it easier to run them from starcheck or elsewhere.Key updates:
ACAReviewTable
class into functions in a newchecks.py
module.list[Message]
.ACACheckTable
or subclass, but that is no longer a requirement.Message
dataclass and moveMessagesList
into newmessages.py
module.ACACheckTable
class that provides the minimal functionality to perform checks. This separates out all the sparkles review functionality (making reports, roll angle optimization, etc) from the basic catalog checking functionality:messages
attribute to capture messagesrow
andcol
etc to facilitate checking the catalogACAReviewTable
andACACheckTable
.The refactoring part is going to be difficult for code review but the tests are solid.
Requires
masters
channel in order to pass tests that depend on sun position.Interface impacts
Testing
Unit tests
sparkles/tests/test_checks.py ............................................................................ [ 73%] sparkles/tests/test_find_er_catalog.py ..... [ 78%] sparkles/tests/test_review.py .................. [ 96%] sparkles/tests/test_yoshi.py .... [100%]
===================================================== 103 passed in 34.39s =====================================================