Skip to content

to_16_point optimization in metno.py file - #925

Merged
chubin merged 2 commits into
chubin:masterfrom
ManchurianMan:master
May 7, 2026
Merged

to_16_point optimization in metno.py file#925
chubin merged 2 commits into
chubin:masterfrom
ManchurianMan:master

Conversation

@ManchurianMan

Copy link
Copy Markdown

Updated to_16_point function in metno.py

Changes:

Improved readability and efficiency.
Added a docstring explaining the input and output of the function.

Comparison:

Accuracy: Verified against the original function across all 360 degrees (both integers and floats). Outputs match.

Speed: Tested using the timeit module at 1,000,000 iterations:

  • to_16_point_v1: 0.13851 seconds
  • to_16_point_v2: 0.12557 seconds

Motivation:

I'm contributing to open source to give back to the community. This change, while small, is a step towards improving wttr.in. Feedback is appreciated!

@chubin
chubin merged commit 1d1c09c into chubin:master May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants