Skip to content

Commit 164900f

Browse files
authored
Merge pull request #57 from mivek/bugfix/recent_intensity
Bugfix/recent intensity
2 parents c5d5eac + cb3cfcf commit 164900f

10 files changed

Lines changed: 127 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Change Log
22

3+
## [1.7.1] - 2023-12-09
4+
5+
### Fixed
6+
7+
- Parsing of `WeatherCondition` tokens with recent (`RE`) intensity.
8+
39
## [1.7.0] - 2023-08-20
410

511
### Added
68 Bytes
Binary file not shown.

metar_taf_parser/locale/en/LC_MESSAGES/messages.po

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,10 @@ msgstr "Light"
334334
msgid "Intensity.+"
335335
msgstr "Heavy"
336336

337+
#:
338+
msgid "Intensity.RE"
339+
msgstr "Recent"
340+
337341
#:
338342
msgid "Intensity.VC"
339343
msgstr "In the vicinity"
1.15 KB
Binary file not shown.

metar_taf_parser/locale/fr/LC_MESSAGES/messages.po

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ msgstr "nuages épars"
3030
msgid "CloudQuantity.SKC"
3131
msgstr "pas de nuage"
3232

33+
#:
34+
msgid "CloudType.AC"
35+
msgstr "Altocumulus"
36+
37+
#:
38+
msgid "CloudType.AS"
39+
msgstr "Altostratus"
40+
3341
#:
3442
msgid "CloudType.CB"
3543
msgstr "Cumunolinbus"
@@ -38,6 +46,30 @@ msgstr "Cumunolinbus"
3846
msgid "CloudType.CC"
3947
msgstr "Cirrocumulus"
4048

49+
#:
50+
msgid "CloudType.CI"
51+
msgstr "Cirrus"
52+
53+
#:
54+
msgid "CloudType.CS"
55+
msgstr "Cirrostratus"
56+
57+
#:
58+
msgid "CloudType.CU"
59+
msgstr "Cumulus"
60+
61+
#:
62+
msgid "CloudType.NS"
63+
msgstr "Nimbostratus"
64+
65+
#:
66+
msgid "CloudType.SC"
67+
msgstr "Stratocumulus"
68+
69+
#:
70+
msgid "CloudType.ST"
71+
msgstr "Stratus"
72+
4173
#:
4274
msgid "CloudType.TCU"
4375
msgstr "Cumulus bourgeonnant"
@@ -70,6 +102,10 @@ msgstr "bonne"
70102
msgid "DepositBrakingCapacity.99"
71103
msgstr "valeurs non fiables"
72104

105+
#:
106+
msgid "DepositBrakingCapacity.default"
107+
msgstr "friction coefficient of {0}"
108+
73109
#:
74110
msgid "DepositCoverage.NOT_REPORTED"
75111
msgstr "non reportée"
@@ -98,6 +134,30 @@ msgstr "non reportée"
98134
msgid "DepositThickness.00"
99135
msgstr "moins de 1 mm"
100136

137+
#:
138+
msgid "DepositThickness.92"
139+
msgstr "10 cm"
140+
141+
#:
142+
msgid "DepositThickness.93"
143+
msgstr "15 cm"
144+
145+
#:
146+
msgid "DepositThickness.94"
147+
msgstr "20 cm"
148+
149+
#:
150+
msgid "DepositThickness.95"
151+
msgstr "25 cm"
152+
153+
#:
154+
msgid "DepositThickness.96"
155+
msgstr "30 cm"
156+
157+
#:
158+
msgid "DepositThickness.97"
159+
msgstr "35 cm"
160+
101161
#:
102162
msgid "DepositThickness.98"
103163
msgstr "40 cm ou plus"
@@ -106,6 +166,10 @@ msgstr "40 cm ou plus"
106166
msgid "DepositThickness.99"
107167
msgstr "fermée"
108168

169+
#:
170+
msgid "DepositThickness.default"
171+
msgstr "{0} mm"
172+
109173
#:
110174
msgid "DepositType.NOT_REPORTED"
111175
msgstr "non reportée"
@@ -270,6 +334,10 @@ msgstr "Faible"
270334
msgid "Intensity.+"
271335
msgstr "Fort"
272336

337+
#:
338+
msgid "Intensity.RE"
339+
msgstr "Récent(e)"
340+
273341
#:
274342
msgid "Intensity.VC"
275343
msgstr "Au voisinage de"
@@ -326,6 +394,10 @@ msgstr "granules de glace"
326394
msgid "Phenomenon.PO"
327395
msgstr "tourbillon de poussières sable"
328396

397+
#:
398+
msgid "Phenomenon.PY"
399+
msgstr "spray"
400+
329401
#:
330402
msgid "Phenomenon.RA"
331403
msgstr "pluie"
@@ -610,6 +682,10 @@ msgstr "couche de nuages variant entre {0} et {1}"
610682
msgid "Remark.Variable.Sky.Condition.Height"
611683
msgstr "couche de nuages à {0} pieds variant entre {1} et {2}"
612684

685+
#:
686+
msgid "Remark.VIRGA"
687+
msgstr "virga"
688+
613689
#:
614690
msgid "Remark.Virga.Direction"
615691
msgstr "virga au {0} de la station"
@@ -698,6 +774,10 @@ msgstr "Sud Ouest"
698774
msgid "Converter.U"
699775
msgstr "accroissement"
700776

777+
#:
778+
msgid "Converter.VRB"
779+
msgstr "Variable"
780+
701781
#:
702782
msgid "Converter.W"
703783
msgstr "Ouest"
@@ -754,10 +834,18 @@ msgstr "altimètre (hPa)"
754834
msgid "ToString.amendment"
755835
msgstr "amendement"
756836

837+
#:
838+
msgid "ToString.auto"
839+
msgstr "auto"
840+
757841
#:
758842
msgid "ToString.baseHeight"
759843
msgstr "Base de la couche en pied"
760844

845+
#:
846+
msgid "ToString.cavok"
847+
msgstr "cavok"
848+
761849
#:
762850
msgid "ToString.clouds"
763851
msgstr "nuages"
@@ -834,6 +922,10 @@ msgstr "message original"
834922
msgid "ToString.name"
835923
msgstr "nom"
836924

925+
#:
926+
msgid "ToString.nosig"
927+
msgstr "nosig"
928+
837929
#:
838930
msgid "ToString.phenomenons"
839931
msgstr "phénomènes"
@@ -890,6 +982,10 @@ msgstr "tendance"
890982
msgid "ToString.trends"
891983
msgstr "tendances"
892984

985+
#:
986+
msgid "ToString.type"
987+
msgstr "type"
988+
893989
#:
894990
msgid "ToString.visibility.main"
895991
msgstr "visibilité principale"
@@ -914,6 +1010,10 @@ msgstr "visibilité verticale (pieds)"
9141010
msgid "ToString.weather.conditions"
9151011
msgstr "conditions météorologique"
9161012

1013+
#:
1014+
msgid "ToString.wind.direction"
1015+
msgstr "direction"
1016+
9171017
#:
9181018
msgid "ToString.wind.direction.degrees"
9191019
msgstr "direction (degrés)"

metar_taf_parser/locale/messages.pot

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,10 @@ msgstr "Light"
334334
msgid "Intensity.+"
335335
msgstr "Heavy"
336336

337+
#:
338+
msgid "Intensity.RE"
339+
msgstr "Recent"
340+
337341
#:
338342
msgid "Intensity.VC"
339343
msgstr "In the vicinity"

metar_taf_parser/model/enum.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ class Intensity(enum.Enum):
105105
LIGHT = '-'
106106
HEAVY = '+'
107107
IN_VICINITY = 'VC'
108+
RECENT = 'RE'
108109

109110
def __repr__(self):
110111
return _('Intensity.' + self.value)

metar_taf_parser/parser/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class AbstractParser(abc.ABC):
9999
BECMG = 'BECMG'
100100
RMK = 'RMK'
101101
TOKENIZE_REGEX = r'\s((?=\d\/\dSM)(?<!\s\d\s)|(?!\d\/\dSM))|='
102-
INTENSITY_REGEX = r'^(-|\+|VC)'
102+
INTENSITY_REGEX = r'^(-|\+|VC|RE)'
103103
CAVOK = 'CAVOK'
104104

105105
def __init__(self):

metar_taf_parser/tests/parser/test_parser.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,16 @@ def test_parse_empty_wind(self):
297297
self.assertEqual(0, metar.wind.speed)
298298
self.assertEqual(0, metar.wind._degrees)
299299

300+
def test_parse_recent_rain(self):
301+
metar = MetarParser().parse('LTAE 250250Z VRB02KT 9999 BKN030 BKN080 06/05 Q1005 RESHRA NOSIG RMK RWY21 07004KT 040V100')
302+
303+
self.assertEqual('LTAE', metar.station)
304+
self.assertEqual(1, len(metar.weather_conditions))
305+
self.assertEqual(Intensity.RECENT, metar.weather_conditions[0].intensity)
306+
self.assertEquals(Descriptive.SHOWERS, metar.weather_conditions[0].descriptive)
307+
self.assertEqual(1, len(metar.weather_conditions[0].phenomenons))
308+
self.assertEqual(Phenomenon.RAIN, metar.weather_conditions[0].phenomenons[0])
309+
300310

301311
class FunctionTestCase(unittest.TestCase):
302312

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = metar-taf-parser-mivek
3-
version = 1.7.0
3+
version = 1.7.1
44
author = Jean-Kevin KPADEY
55
author_email = jeankevin.kpadey@gmail.com
66
description = Python project parsing metar and taf message

0 commit comments

Comments
 (0)