FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add an extra copy of the wind and visibility, to enable parsing of ME… · python-metar/python-metar@74dabf6 · GitHub

Commit 74dabf6

Browse files
committed
Add an extra copy of the wind and visibility, to enable parsing of METARs that list wind and visibility after the sky condition groups.
Fixes #147.
1 parent 2f1be43 commit 74dabf6

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

‎metar/Metar.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,6 +1050,8 @@ def _unparsedRemark(self, d):
10501050
(RUNWAY_RE, _handleRunway, True),
10511051
(WEATHER_RE, _handleWeather, True),
10521052
(SKY_RE, _handleSky, True),
1053+
(WIND_RE, _handleWind, False),
1054+
(VISIBILITY_RE, _handleVisibility, True),
10531055
(TEMP_RE, _handleTemp, False),
10541056
(PRESS_RE, _handlePressure, True),
10551057
(RECENT_RE, _handleRecent, True),

‎test/test_metar.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,3 +653,17 @@ def test_cor_auto_mod():
653653
m = Metar.Metar(code, year=2019)
654654

655655
assert m.mod == 'COR AUTO'
656+
657+
def test_wind_after_sky():
658+
"""
659+
Test parsing of a METAR that lists wind after the sky groups
660+
"""
661+
662+
code = (
663+
"METAR KCOF 281855Z FEW029TCU FEW040 SCT250 09008KT 7SM 32/25 A3008 "
664+
"RMK VIRGA E TCU NE AND DSNT ALQDS SLP186"
665+
)
666+
m = Metar.Metar(code, year=2007)
667+
668+
assert m.wind_dir.value() == 90
669+
assert m.wind_speed.value() == 8

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL