avwx-rest / avwx-engine

Aviation Weather parsing engine. METAR & TAF
MIT License
89 stars 30 forks source link

Fixed the issue where parts of the report were missing. #63

Open yjmp14 opened 1 month ago

yjmp14 commented 1 month ago

Description

Incorrect use of the dedupe() function caused some content to be lost from the message retrieved from the webpage. For example, 091100Z 0912/1018 12005KT 3500 BR RA SCT025 FEW030CB BKN080 BECMG 0915/0917 14005KT 3000 **BR** -RA **SCT025** BKN090 TEMPO 1000/1004 11008KT 1500 TSRA FEW015 **SCT025 FEW030CB** OVC090 **BECMG** 1005/1007 11010G20KT 2500 **BR -RA SCT025 BKN090 BECMG** 1015/1017 **14005KT 3000 BR -RA** FEW030 SCT090 After the dedupe(), the message comes to, 091100Z 0912/1018 12005KT 3500 BR RA SCT025 FEW030CB BKN080 BECMG 0915/0917 14005KT 3000 -RA BKN090 TEMPO 1000/1004 11008KT 1500 TSRA FEW015 OVC090 1005/1007 11010G20KT 2500 1015/1017 FEW030 SCT090 many parts are lost.

This PR fixed this issue.

Checklist

devdupont commented 1 month ago

Good catch. I think the original intention was to use dedupe(report.split(), only_neighbors=True) which would still yield the desired result.