test: exclude optional plotting extra from coverage and unit-test _compute_extent - #13
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is a small coverage-reporting cleanup, not new test logic. After Phases 1–4, every module except
plotting.pysits at 76–100% coverage, but the headline number was a misleading 64% — becauseplotting.py(an optional visualization extra whose matplotlib/cartopy dependencies are not installed in CI) was being measured at ~5% and single-handedly dragging the total down. This PR makes the reported number reflect the code CI actually exercises, and adds a small real test for the one piece ofplotting.pythat contains pure logic.What changes
pyproject.toml— excludeplotting.pyfrom coverage measurement viaomit = ["*/plotting.py"]under[tool.coverage.run], with a comment explaining why.plotting.pyis an optional extra (pip install groundtrack[plotting]); itsmatplotlib/cartopydependencies are intentionally not installed in CI, so its statements cannot be fairly measured there. Theplot_*functions are thin cartopy/matplotlib wrappers that end inplt.show()— there is no meaningful logic to assert without brittle image-comparison tests, and a broken plot is immediately visible to the user rather than silently corrupting scientific output.tests/test_plotting.py— add 6 unit tests for_compute_extent, the only pure function inplotting.py(it computes the map bounding box from track/station coordinates usingnumpy+wrap_lon_deg, and imports fine without matplotlib/cartopy). Covers the global fallback, padding, custom pad, stations-only, combined track+stations, and longitude wrapping. So the omitted module is not literally untouched — its one piece of real logic is verified.Effect on coverage
plotting.py)plotting.pyomitted)This is reporting only — no production code changed, and the omitted module's only logic is now tested. Every CI-exercised module remains at 76–100%.
Testing
pytest # 118 passed, fully offline