-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Zero wind" (00000KT
) scenario not completely handled
#61
Comments
Hello @SkySails Sorry for the delay.
is the right regex. Thank you for your analysis of the bug, I will push a fix. |
No worries at all! Ah, I should have looked through the issue history too, that's my bad. Thank you for referencing it! |
This PR fixes #61 and the regex of the calm wind which is represented by `00000KT` and not `0000KT`. Visibility should not be parsed aas wind.
Hello @SkySails I merged the fix and released a new version Thanks again for reporting the issue |
That's great news! Thank you for fixing it! |
This is a fix to mivek/python-metar-taf-parser#61. The calm wind was parsed as a visibility token.
Hello! First of all, thank you for your awesome work on this family of parsers 🙌
I am debugging an issue in the Typescript port of this project, and it seems like the same thing occurs over here and since that other project is a port, I think it's best to work with this upstream first!
The following METAR report incorrectly parses to the wrong unit:
The result, as per https://www.metar-taf-decoder.com, is
Wind: Speed : 0 KT Direction : North | 0°
-KT
instead ofMPS
.This is a really small issue, but it has other consequences in the Typescript port which you can read about in the linked issues at the bottom!
Related issues
00000KT
) scenario not completely handled aeharding/metar-taf-parser#80More details
The culprit seems to be this regex, as it results in the following incorrect matching:
python-metar-taf-parser/metar_taf_parser/command/common.py
Line 82 in 164900f
It seems to be there to satisfy this test case, which includes an invalid METAR string according to the specifications I can find. As usual, most are not too explicit on the matter but this is one example:
So I guess this is a case of choosing which case to support. If we change the regex by adding an additional required zero:
The unit is now correctly parsed and the speed is correctly registered (not that it matters, it's all zeros anyway)
The downside is that the test case will start to fail. Is there a reason behind supporting
0000KT
(four digits) specifically? Is it a common occurrence in the real world?The text was updated successfully, but these errors were encountered: