Skip to content

Commit

Permalink
Replaced '__contains__' with 'in'
Browse files Browse the repository at this point in the history
  • Loading branch information
RoryPTB authored Mar 7, 2024
1 parent 9d3071a commit 9ddbc2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions synop2bufr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,7 @@ def extract_individual_synop(data: str) -> list:
# 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"):
if "AAXX" in data[0]:
raise ValueError((
f"The following SYNOP message is invalid: {data[0]}"
" Please check again for typos."
Expand All @@ -1238,7 +1238,7 @@ def extract_individual_synop(data: str) -> list:
if "AAXX" in d:
s0 = d
else:
if not d.__contains__("="):
if "=" not in d:
raise ValueError((
"Delimiters (=) are not present in the string,"
" thus unable to identify separate SYNOP reports."
Expand Down

0 comments on commit 9ddbc2d

Please sign in to comment.