Repository navigation
BUG: Keep altimeter when METAR temperature group is ///// (Fixes #4217) - #4218
Open
CharlesXmf wants to merge 1 commit into
Open
CharlesXmf wants to merge 1 commit into
CharlesXmf wants to merge 1 commit into
Conversation
…ata#4217) Present weather accepted "//" at the start of a missing temperature/dewpoint group ("/////"), so later groups including the altimeter were lost. Prevent weather and cloud rules from matching that exact group and regenerate the Canopy parser. Co-authored-by: Charles <CharlesXmf@users.noreply.github.com>
|
|
| address1 = FAILURE | ||
| if address1 is not FAILURE: | ||
| elements0.append(address1) | ||
| address3 = FAILURE |
| self._expected.append(('METAR::missing_td', '"/////"')) | ||
| if address3 is not FAILURE: | ||
| elements0.append(address3) | ||
| address4 = FAILURE |
| return cached[0] | ||
| index1 = self._offset | ||
| index2, elements0 = self._offset, [] | ||
| address1 = FAILURE |
| address1 = FAILURE | ||
| if address1 is not FAILURE: | ||
| elements0.append(address1) | ||
| address2 = FAILURE |
| while True: | ||
| index3, elements1 = self._offset, [] | ||
| index2, elements0 = self._offset, [] | ||
| address1 = FAILURE |
| index4, elements1, address3 = self._offset, [], None | ||
| while True: | ||
| index5, elements2 = self._offset, [] | ||
| address4 = FAILURE |
| address4 = self._read_sep() | ||
| if address4 is not FAILURE: | ||
| elements2.append(address4) | ||
| address5 = FAILURE |
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.
Fixes #4217.
A temperature/dewpoint group of exactly
/////was partially consumed by present weather (//) and never reached the altimeter.parse_metarthen returnednanfor altimeter even whenQ/Awas present. Only temperature and dewpoint should be missing.The grammar in
tools/metar_parser/metar_parser.pegnow skips weather and cloud matches for a complete/////group, then the Canopy parser is regenerated (canopy metar_parser.peg --lang python --output ../../src/metpy/io/_metar_parserfromtools/metar_parser, Canopy 0.4.1).Verified with
pytest tests/io/test_metar.py(44 passed), including the AWC examples:SKUC 290500Z AUTO VRB01KT CAVOK ///// Q1012→ altimeter 29.88 inHg (1012 hPa); temp/dewpoint missingEGLL 010000Z AUTO 00000KT 2000 ///// Q1013→ altimeter 29.91 inHg (1013 hPa); temp/dewpoint missingThe same reports with
24/20/15/10still parse the altimeter. The bulk METAR file now finds 3 more altimeters from the same pattern.