Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions metar/Metar.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ def xlate_loc(loc):
"FC": "funnel cloud",
"SS": "sandstorm",
"DS": "dust storm",
"NSW": "no significant weather",
}

WEATHER_SPECIAL = {"+FC": "tornado"}
Expand Down
31 changes: 31 additions & 0 deletions test/test_metar.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,3 +699,34 @@ def test_windshear_runway_identifier():
assert len(m.windshear) == 1
assert m.windshear[0] == "22L"


def test_present_weather_others():
# PO, sand whirls
code = "VEIM 301200Z 16007KT 7000 PO SCT018 31/27 Q1007 NOSIG"
m = Metar.Metar(code, month=8, year=2023)
assert m.present_weather() == 'sand whirls'

# SQ, squalls
code = "VEIM 301200Z 16007KT 7000 SQ SCT018 31/27 Q1007 NOSIG"
m = Metar.Metar(code, month=8, year=2023)
assert m.present_weather() == 'squalls'

# FC, funnel cloud
code = "VEIM 301200Z 16007KT 7000 FC SCT018 31/27 Q1007 NOSIG"
m = Metar.Metar(code, month=8, year=2023)
assert m.present_weather() == 'funnel cloud'

# SS, sandstorm
code = "VEIM 301200Z 16007KT 7000 SS SCT018 31/27 Q1007 NOSIG"
m = Metar.Metar(code, month=8, year=2023)
assert m.present_weather() == 'sandstorm'

# DS, dust storm
code = "VEIM 301200Z 16007KT 7000 DS SCT018 31/27 Q1007 NOSIG"
m = Metar.Metar(code, month=8, year=2023)
assert m.present_weather() == 'dust storm'

# NSW, No significant weather
code = "VEIM 301200Z 16007KT 7000 NSW SCT018 31/27 Q1007 NOSIG"
m = Metar.Metar(code, month=8, year=2023)
assert m.present_weather() == 'no significant weather'