avwx-rest / avwx-engine

Aviation Weather parsing engine. METAR & TAF
MIT License
90 stars 31 forks source link

typehint MetarData and TafData on Metar and Taf classes #34

Closed mralext20 closed 3 years ago

mralext20 commented 3 years ago

this should improve developer experience.

devdupont commented 3 years ago

I'll merge this later tonight and start expanding my local mypy coverage. That should definitely help.

mralext20 commented 3 years ago

I'm personally not using mypy, just vscode with pylance. Another thing I noticed: avwx.Metar().data.wind_guest might be optional[Number] instead of Number.

Not sure about the other wind_things

devdupont commented 3 years ago

Yeah practically every major dataclass in the report is Optional except for flight rules - the mere absence of criteria results in IFR by regulation. I started by running mypy on the core components and started working my way up but got distracted. I'll bring everything back up to speed so it should work with pylance and other code servers.