8000 Added a 'COR AUTO' case for modifier by jhaiduce · Pull Request #122 · python-metar/python-metar · GitHub
[go: up one dir, main page]

Skip to content
Closed
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
2 changes: 1 addition & 1 deletion metar/Metar.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ParserError(Exception):
(?P<min>\d\d)Z?\s+""",
re.VERBOSE,
)
MODIFIER_RE = re.compile(r"^(?P<mod>AUTO|FINO|NIL|TEST|CORR?|RTD|CC[A-G])\s+")
MODIFIER_RE = re.compile(r"^(?P<mod>AUTO|COR AUTO|FINO|NIL|TEST|CORR?|RTD|CC[A-G])\s+")
WIND_RE = re.compile(
r"""^(?P<dir>[\dO]{3}|[0O]|///|MMM|VRB)
(?P<speed>P?[\dO]{2,3}|[/M]{2,3})
Expand Down
8 changes: 8 additions & 0 deletions test/test_metar.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,3 +602,11 @@ def test_not_strict_mode():
assert report.station_id == "K9L2"
assert report.vis.value() == 10
assert report.sky_conditions() == "clear"

def test_cor_auto_mod():
code = """METAR KADW 252356Z COR AUTO 10008KT 10SM CLR 19/11 A2986
RMK AO2 SLP117 T01880111 10230 20188 50004 $ COR
0007="""
m=Metar.Metar(code,year=2019)

assert m.mod=='COR AUTO'
0