Fix three latent bugs in Grid construction and mode regridders#68
Open
thodson-usgs wants to merge 1 commit into
Open
Fix three latent bugs in Grid construction and mode regridders#68thodson-usgs wants to merge 1 commit into
thodson-usgs wants to merge 1 commit into
Conversation
f36c938 to
bc81ecd
Compare
- utils.create_lat_lon_coords: check remainder against resolution_lon (not resolution_lat) for the longitude span, so non-square grids no longer overshoot `east`. - Grid.__post_init__: the `south > north` branch now reports the correct bound in the error message, and the second check uses `elif` so the first failure isn't silently overwritten. Drops a stray `pass`. - regrid.most_common / regrid.least_common: the Dataset-input error message was a tuple (trailing comma on the first string literal), so ValueError printed unreadably. Remove the comma so the message is a single string.
bc81ecd to
c2414bb
Compare
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.
Three small, independent bug fixes spotted while reading the code.
utils.create_lat_lon_coords— the longitude-span check usesresolution_latinstead ofresolution_lon, so non-square grids can overshooteast.Grid.__post_init__— thesouth > northbranch reports the wrong bound name, and the two checks useif/ifso the second overwrites the first. Switched toelifand fixed the wording. Drops a straypass.regrid.most_common/regrid.least_common— the Dataset-input error message has a stray comma makingmsga tuple, soValueError(msg)renders unreadably.