Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing of "calm wind" #81

Merged
merged 4 commits into from
Jan 26, 2024
Merged

Conversation

SkySails
Copy link
Collaborator

This PR fixes a small issue introduced earlier this year in #66

The METAR mentioned in this issue was KATW 022045Z 0000KT 10SM SCT120 00/M08 A2996, which contains an invalid "winds calm" value according to the Federal Meteorological Handbook:

d) Calm Wind. Calm wind shall be coded as "00000KT"
The first three zeros represent the wind direction and the last two zeros represent the speed.

Those changes to the regex prevented correct unit parsing for correct reports and introduced a bug where visibility values would be mistaken for wind speed.

This has been fixed upstream: mivek/python-metar-taf-parser#63

Fixes #79 , fixes #80

@aeharding
Copy link
Owner

Thanks for the PR! Looks like lint is failing though.

@SkySails
Copy link
Collaborator Author

Sorry, my bad (again). I ran yarn check-formatting and npm run check-formatting, but both returned the following result:

> metar-taf-parser@8.0.4 check-formatting
> prettier --check '**/*.{js,json,css,md,scss,tsx,ts}'

Checking formatting...
[error] No files matching the pattern were found: "'**/*.{js,json,css,md,scss,tsx,ts}'".
All matched files use Prettier code style!

I now tried npx prettier --check '**/*.{js,json,css,md,scss,tsx,ts}' instead of using the package script, and that did get me the correct warning! Should be fixed now.

@SkySails
Copy link
Collaborator Author

Seems like the problem went away as soon as I removed the single quotes from the pattern in that command. Perhaps it's an OS-specific issue?

@aeharding
Copy link
Owner

Looks good, thanks!

@aeharding aeharding merged commit 283e92f into aeharding:main Jan 26, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants