-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a unit test for dyn bgd hotpix imposter calc #418
Conversation
7f963e3
to
82750bd
Compare
@taldcroft I don't know if we actually want to merge this or something like it, but it seemed a reasonable way to document what I did for functional test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! There was only one real issue with using >=
or <=
instead of splitting to >
and ==
. Then I saw an opportunity to simplify the code and started typing.
Co-authored-by: Tom Aldcroft <taldcroft@gmail.com>
Co-authored-by: Tom Aldcroft <taldcroft@gmail.com>
Co-authored-by: Tom Aldcroft <taldcroft@gmail.com>
Co-authored-by: Tom Aldcroft <taldcroft@gmail.com>
OK. Thanks. I just committed your changes and re-ran the test successfully. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now. I ran the test and got a pass. Not required, but probably worth cleaning up these warnings by preceding the regex string with r
.
============================================= warnings summary ==============================================
starcheck/pcad_att_check.py:51
/Users/aldcroft/git/starcheck/starcheck/pcad_att_check.py:51: DeprecationWarning: invalid escape sequence '\d'
match = re.match('^(\d+\.\d+)\s+\|\s+(\S+)\s*$',
starcheck/pcad_att_check.py:67
/Users/aldcroft/git/starcheck/starcheck/pcad_att_check.py:67: DeprecationWarning: invalid escape sequence '\d'
match = re.match('^(\d+\.\d+)\s+\|\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s*', line)
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
Thanks! And I'm fine with making those regex changes if we are fine with a "starcheck still seemed to run ok" test for the record as enough testing for that. |
Though actually... what are you doing to see those pcad_att_check warnings? |
Description
Add a unit test for dyn bgd hotpix imposter calc. Maybe it is a bridge too far for the #412 PR, but we could start to accumulate Python unit tests here as we go. This is not a particularly clean unit test; I suppose it would be better to ask sparkles what we want for dyn_bgd_n_faint and dyn_bgd_dt_ccd or some such? But this does work as a functional test for the imposter calc.
This addresses the issue at the end of #412 that the functional testing of the imposter calculation was not demonstrated.
Interface impacts
Testing
I tested this with install testing into my ska3-matlab-2023.4rc6 environment.
Unit tests
Independent check of unit tests by [REVIEWER NAME]
Functional tests
No functional testing.