Repository navigation
Allow repeated, leading and trailing spaces in coordinates and ancillary_variables - #693
Open
ZackaryLoevseth wants to merge 1 commit into
Open
ZackaryLoevseth wants to merge 1 commit into
ZackaryLoevseth wants to merge 1 commit into
Conversation
CF allows blank-separated lists to use several spaces between names and
to start or end with spaces. Splitting coordinates and
ancillary_variables with split(" ") produced empty names.
This branch has not been deployed
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.
CF 1.12 §2.6 allows a blank-separated list to have more than one space between names and to begin or end with spaces.
get_associated_variable_namessplitscoordinatesandancillary_variableswithsplit(" "), so these produce empty names: withcoordinates=" lat lon ",ds.cf["temp"]raisesUnboundLocalError, and a doubled space warns that a variable named''is missing.This changes both to
split(). The new test covers both attributes, inattrsandencoding, with repeated, leading and trailing spaces, and checks the associated names, the selection, that no warning is raised and that the input is unchanged. 16 of its 20 cases fail on main; all pass with the change, and the full suite passes.flag_meaningshas the same problem ("low high"raises aValueError); I can send that separately.