Deprecate 'get_area_extent_for_subset' and fix incorrect return value - #749
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #749 +/- ##
==========================================
+ Coverage 93.68% 93.71% +0.03%
==========================================
Files 89 89
Lines 13721 13716 -5
==========================================
Hits 12854 12854
+ Misses 867 862 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Sphinx was complaining about bad type definitions in the docstring of 'get_area_extent_for_subset'. I decided to move the types to normal type annotations since we use that elsewhere. This revealed that this method hasn't returned a tuple of scalars since 2018. This method was added in 2018 in #44 and then later we changed how the
get_proj_*methods work and dropped this scalar use case. Since no tests were ever added for this method the breakage was never caught. In this PR I fix the type annotations and deprecate the method in favor of the slicing logic available forAreaDefinitionto create a subset area and then get the area extent. Oh yeah, Claude pointed out that this method was on theBaseDefinitionbut was using methods that only existed on theAreaDefinition.I also added type annotations to a helper function when I was confused about how I wanted to replace the internals of this method.
Bottom line: This method has been broken for years, it is being removed.
CC @meteoswiss-mdr who originally added in in #44 (Ulrich)