-
Notifications
You must be signed in to change notification settings - Fork 24
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
Remove unused code and expand unit tests #2425
Conversation
@sbailey, we may need to check the coverage configuration. The tests themselves are being included in the code to be tested and that is significantly decreasing the coverage. |
The fiberflat gradient test is consistently failing on some but not all github configurations, and passing at NERSC and on my laptop. This smells like individual tests having side effects that impact the results if run in a different order, but I haven't figured out what the core issue is. |
Curious. What I originally posted was run with And, after adding debug printouts trying to figure out why the fiberflat tests are failing on github, they are working again. I'll poke at that a bit more, but if they continue to pass I'll accept that. :) |
I slightly disagree with that. The number passed to Coveralls is what people see on GitHub. I know there are reasons that number may be different from the number at NERSC. Effectively, nobody but you ever sees that number. Conceptually, I think passing |
Due to PR #2424 adding |
I think the following should also be deprecated. The first two I already pointed out privately: |
Thanks for identifying those additional deprecated scripts. I moved those and also moved |
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.
Thank you for this needed spring cleaning. 112 is more files than I expected this to touch, but everything looks appropriate.
I won't merge until you've sorted out the test_gradient_correction
test that is still failing:
FAILED py/desispec/test/test_fiberflat.py::TestFiberFlatObject::test_gradient_correction - RuntimeError: gradient center-to-edge difference larger than 20.0% !
Everything else looks good. I didn't do an in-depth analysis of all the unit tests as there were too any of them, but from going through them they generally look good.
I went through all of desispec and identified several other files to deprecate, which I posted separately and have already been addressed (thank you). I didn't find any outstanding issues of dependencies on deprecated code, so hopefully we are covered there.
Now we're showing a coverage increase, so I think that configuration is all set. |
What I meant by "cosmetic" is that a) what really matters is what our coverage is, not what some badge says; and b) regardless of whether the tests themselves are included in the stats or not and whether we are running at NERSC or not, our coverage is low and the difference of the tests doesn't move us from a respectable coverage to an embarrassing level anyway. It's low in either case. That being said, if there is a cleaner way to configure that, great. I don't understand why the .coveragerc file isn't already excluding desispec.test from the stats. UPDATE: while I was typing that, @weaverba137 added a commit moving pytest and coverage info to setup.cfg. Nevermind.
That is a temporary hack to prevent it from discovering tests in the deprecated/ directory which we plan to remove after converging on what is supposed to be deprecated. I could have done this via a pytest.ini file instead which I admit would have been a bit cleaner. I see that while I was typing this, @akremin approved the changes, so now before merging I will remove the deprecated/ directory and restore the github actions pytests to fully auto-discover. The fiberflat tests stopped failing without me taking specific action and now I can't get them to fail again, so I'm going to move on unless/until the failures re-appear. |
Please make sure you have picked up my latest change. I would not recommend further changes to the GiHub Actions configuration. |
This maintenance PR removes unused code and expands unit test coverage of remaining code. For the moment the "removed" code was actually moved to a deprecated/ directory so that we can easily get it back if I moved too much without having to swap branches, but the intension is to delete the deprecated/ directory once we are sure this is ok.
Removed modules and related scripts and tests:
Expanded/Updated tests for badcolumn, binscripts, bootcalib, efftime, fiberflat, image_model, workflow.timing, xytraceset.
New features to make some of the tests easier / faster:
With these updates, the coverage when run at NERSC increases from 27% to 47%; see https://data.desi.lbl.gov/desi/users/sjbailey/temp/htmlcov_pr/ . That's still low coverage but this branch is getting to be a lot of changes, so I suggest that we review this now and then further expand coverage in future PRs.