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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
python-version: '3.13'
- name: Install dependencies
run: npm install
- name: Run semantic-release
Expand Down
6 changes: 4 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ parameterized = "*"
coverage = "*"

[packages]

build = "*"
wheel = "*"
setuptools = "*"
twine = "*"

[requires]

680 changes: 622 additions & 58 deletions Pipfile.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion metar_taf_parser/command/remark.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ def can_parse(self, code: str) -> any:


class TornadicActivityBegCommand(Command):
regex = '^(TORNADO|FUNNEL CLOUD|WATERSPOUT) (B(\d{2})?(\d{2}))( (\d+)? ([A-Z]{1,2})?)?'
regex = r'^(TORNADO|FUNNEL CLOUD|WATERSPOUT) (B(\d{2})?(\d{2}))( (\d+)? ([A-Z]{1,2})?)?'

def __init__(self):
self._pattern = re.compile(TornadicActivityBegCommand.regex)
Expand Down
Binary file modified metar_taf_parser/locale/de/LC_MESSAGES/messages.mo
Binary file not shown.
4 changes: 4 additions & 0 deletions metar_taf_parser/locale/de/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ msgstr ""
msgid "CloudQuantity.BKN"
msgstr "stark bewölkt"

#:
msgid "CloudQuantity.CLR"
msgstr "wolkenlos"

#:
msgid "CloudQuantity.FEW"
msgstr "leicht bewölkt"
Expand Down
Binary file modified metar_taf_parser/locale/en/LC_MESSAGES/messages.mo
Binary file not shown.
4 changes: 4 additions & 0 deletions metar_taf_parser/locale/en/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ msgstr ""
msgid "CloudQuantity.BKN"
msgstr "broken"

#:
msgid "CloudQuantity.CLR"
msgstr "sky clear"

#:
msgid "CloudQuantity.FEW"
msgstr "few"
Expand Down
Binary file modified metar_taf_parser/locale/es/LC_MESSAGES/messages.mo
Binary file not shown.
4 changes: 4 additions & 0 deletions metar_taf_parser/locale/es/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ msgstr ""
"X-Generator: prop2po"
"Project-Id-Version: metar_taf_parser"
"Language: es"
#:
msgid "CloudQuantity.CLR"
msgstr "cielo despejado"

#:
msgid "CloudQuantity.NSC"
msgstr "sin nubes significativas."
Expand Down
Binary file modified metar_taf_parser/locale/fr/LC_MESSAGES/messages.mo
Binary file not shown.
4 changes: 4 additions & 0 deletions metar_taf_parser/locale/fr/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ msgstr ""
msgid "CloudQuantity.BKN"
msgstr "nuages fragmentés"

#:
msgid "CloudQuantity.CLR"
msgstr "ciel dégagé"

#:
msgid "CloudQuantity.FEW"
msgstr "peu"
Expand Down
Binary file modified metar_taf_parser/locale/it/LC_MESSAGES/messages.mo
Binary file not shown.
4 changes: 4 additions & 0 deletions metar_taf_parser/locale/it/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ msgstr ""
msgid "CloudQuantity.BKN"
msgstr "molto nuvoloso"

#:
msgid "CloudQuantity.CLR"
msgstr "cielo sereno"

#:
msgid "CloudQuantity.FEW"
msgstr "leggermente nuvoloso"
Expand Down
4 changes: 4 additions & 0 deletions metar_taf_parser/locale/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ msgstr ""
msgid "CloudQuantity.BKN"
msgstr "broken"

#:
msgid "CloudQuantity.CLR"
msgstr "sky clear"

#:
msgid "CloudQuantity.FEW"
msgstr "few"
Expand Down
Binary file modified metar_taf_parser/locale/pl/LC_MESSAGES/messages.mo
Binary file not shown.
4 changes: 4 additions & 0 deletions metar_taf_parser/locale/pl/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ msgstr ""
msgid "CloudQuantity.BKN"
msgstr "Od 5/8 do 7/8"

#:
msgid "CloudQuantity.CLR"
msgstr "czyste niebo"

#:
msgid "CloudQuantity.FEW"
msgstr "Od 1/8 do 2/8"
Expand Down
Binary file modified metar_taf_parser/locale/ru-RU/LC_MESSAGES/messages.mo
Binary file not shown.
4 changes: 4 additions & 0 deletions metar_taf_parser/locale/ru-RU/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ msgstr ""
msgid "CloudQuantity.BKN"
msgstr "разорванная"

#:
msgid "CloudQuantity.CLR"
msgstr "ясное небо"

#:
msgid "CloudQuantity.FEW"
msgstr "незначительная"
Expand Down
Binary file modified metar_taf_parser/locale/tr/LC_MESSAGES/messages.mo
Binary file not shown.
4 changes: 4 additions & 0 deletions metar_taf_parser/locale/tr/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ msgstr ""
msgid "CloudQuantity.BKN"
msgstr "parçalı çok bulutlu"

#:
msgid "CloudQuantity.CLR"
msgstr "gökyüzü açık"

#:
msgid "CloudQuantity.FEW"
msgstr "az bulutlu"
Expand Down
Binary file modified metar_taf_parser/locale/zh-CN/LC_MESSAGES/messages.mo
Binary file not shown.
6 changes: 5 additions & 1 deletion metar_taf_parser/locale/zh-CN/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ msgstr ""
"Content-Transfer-Encoding: 8bit"
"X-Generator: prop2po"
"Project-Id-Version: metar_taf_parser"
"Language: zn-CN"
"Language: zh-CN"
#:
msgid "CloudQuantity.BKN"
msgstr "5-7分云"

#:
msgid "CloudQuantity.CLR"
msgstr "天空晴朗"

#:
msgid "CloudQuantity.FEW"
msgstr "少云"
Expand Down
5 changes: 3 additions & 2 deletions metar_taf_parser/model/enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@


class CloudQuantity(enum.Enum):
SKC = 'SKC' # Sky clear
FEW = 'FEW' # Few
CLR = 'CLR' # Clear
SKC = 'SKC' # Sky clear
FEW = 'FEW' # Few
BKN = 'BKN' # Broken
SCT = 'SCT' # Scattered
OVC = 'OVC' # Overcast
Expand Down
6 changes: 3 additions & 3 deletions metar_taf_parser/model/model.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import abc
from datetime import time
import datetime

from metar_taf_parser.model.enum import Descriptive, Flag, WeatherChangeType, TimeIndicator, IcingIntensity, TurbulenceIntensity

Expand Down Expand Up @@ -537,7 +537,7 @@ def _set_day(self, value: int):
def _get_time(self):
return self._time

def _set_time(self, value: time):
def _set_time(self, value: datetime.time):
self._time = value

def _get_message(self):
Expand Down Expand Up @@ -717,7 +717,7 @@ def _get_type(self):
def _get_time(self):
return self._time

def _set_time(self, value: time):
def _set_time(self, value: datetime.time):
self._time = value

def __repr__(self):
Expand Down
2 changes: 1 addition & 1 deletion metar_taf_parser/parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def _extract_lines_tokens(self, taf_code: str):
"""
single_line = taf_code.replace('\n', ' ')
clean_line = re.sub(r'\s{2,}', ' ', single_line)
lines = re.sub(r'\s(PROB\d{2}\sTEMPO|TEMPO|INTER|BECMG|FM(?![A-Z]{2}\s)|PROB)', '\n\g<1>', clean_line).splitlines()
lines = re.sub(r'\s(PROB\d{2}\sTEMPO|TEMPO|INTER|BECMG|FM(?![A-Z]{2}\s)|PROB)', r'\n\g<1>', clean_line).splitlines()
lines_token = [self.tokenize(line) for line in lines]

if len(lines_token) > 1:
Expand Down
7 changes: 7 additions & 0 deletions metar_taf_parser/tests/parser/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,13 @@ def test_parse_recent_rain(self):
self.assertEqual(1, len(metar.weather_conditions[0].phenomenons))
self.assertEqual(Phenomenon.RAIN, metar.weather_conditions[0].phenomenons[0])

def test_parse_clr(self):
metar = MetarParser().parse('LFRM 081630Z AUTO 30007KT 260V360 9999 CLR')

self.assertEqual('LFRM', metar.station)
self.assertEqual(1, len(metar.clouds))
self.assertEqual(CloudQuantity.CLR, metar.clouds[0].quantity)


class FunctionTestCase(unittest.TestCase):

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
requires = [
"setuptools>=42",
"setuptools >= 77.0.3",
"wheel"
]
build-backend = "setuptools.build_meta"
Expand All @@ -10,7 +10,7 @@ name = "metar-taf-parser-mivek"
version = "1.9.0"
description = "Python project parsing metar and taf message"
readme = "README.md"
requires-python = ">=3.7"
requires-python = ">=3.9"
license = "MIT"
license-files = ["LICENSE"]
authors = [
Expand Down