From 9d3071ad00aa507a09f8787e879a8673cbcbbe59 Mon Sep 17 00:00:00 2001 From: RoryPTB <47696929+RoryPTB@users.noreply.github.com> Date: Thu, 7 Mar 2024 11:15:54 +0100 Subject: [PATCH] Improved SYNOP typo check explanation --- synop2bufr/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/synop2bufr/__init__.py b/synop2bufr/__init__.py index 4c4f7bc..94bd4fb 100644 --- a/synop2bufr/__init__.py +++ b/synop2bufr/__init__.py @@ -1221,9 +1221,10 @@ def extract_individual_synop(data: str) -> list: # Split the string by AAXX YYGGiw data = re.split(r'(AAXX\s+[0-9]{5})', data[start_position:]) - # Check if the beginning of the message, that we're about to throw - # away (data[0]), also contains AAXX and thus there must be a - # typo present at the AAXX YYGGiw part of the report + # Check if the beginning of the message (e.g. ZCZC 123 etc.) + # that we're about to throw away (data[0]) also contains AAXX. + # If this is true, there must be a typo present at the AAXX YYGGiw + # part and thus we can't process the message. if data[0].__contains__("AAXX"): raise ValueError(( f"The following SYNOP message is invalid: {data[0]}"