From 6e930df4858c00e11f1c7dc0fe9808839ef9bb4c Mon Sep 17 00:00:00 2001 From: John Haiducek Date: Sat, 5 Dec 2020 19:03:11 -0500 Subject: [PATCH 1/2] Added a 'COR AUTO' case for modifier --- metar/Metar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metar/Metar.py b/metar/Metar.py index 9ac23dbe..bbe3e6ef 100644 --- a/metar/Metar.py +++ b/metar/Metar.py @@ -43,7 +43,7 @@ class ParserError(Exception): (?P\d\d)Z?\s+""", re.VERBOSE, ) -MODIFIER_RE = re.compile(r"^(?PAUTO|FINO|NIL|TEST|CORR?|RTD|CC[A-G])\s+") +MODIFIER_RE = re.compile(r"^(?PAUTO|COR AUTO|FINO|NIL|TEST|CORR?|RTD|CC[A-G])\s+") WIND_RE = re.compile( r"""^(?P[\dO]{3}|[0O]|///|MMM|VRB) (?PP?[\dO]{2,3}|[/M]{2,3}) From 843efc5b4848ab33189aa79ef8e3aed9bfa32a0e Mon Sep 17 00:00:00 2001 From: John Haiducek Date: Sat, 5 Dec 2020 19:24:23 -0500 Subject: [PATCH 2/2] Added a test of parsing a METAR with a 'COR AUTO' modifier --- test/test_metar.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/test_metar.py b/test/test_metar.py index 3770bafc..0184cc18 100644 --- a/test/test_metar.py +++ b/test/test_metar.py @@ -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'