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

block[weather]: Fix nws apparent temperature #2069

Merged
merged 2 commits into from
Jul 25, 2024

Conversation

bim9262
Copy link
Collaborator

@bim9262 bim9262 commented Jul 10, 2024

australian_apparent_temp requires m/s not km/h.
convert temperature back to fahrenheit if original temperature is in fahrenheit

@Cognoscan does this capture the changes that you mentioned on your PR?

australian_apparent_temp requires m/s not km/h.
convert temperature back to fahrenheit if original
temperature is in fahrenheit
@Cognoscan
Copy link
Contributor

Cognoscan commented Jul 10, 2024

Almost. There's one other possible issue, which is that other services using metric units use m/s for wind, whereas NWS will return km/h when metric units are requested. I'm not sure if that matters or not.

@bim9262
Copy link
Collaborator Author

bim9262 commented Jul 10, 2024

Good call, I think it would be best to keep the speeds in standard units regardless of backend

@@ -177,8 +185,13 @@ impl ApiForecast {
(self.temperature.value - 32.0) * 5.0 / 9.0
};
let humidity = self.relative_humidity.value;
let wind_speed = self.wind_kmh();
australian_apparent_temp(temp, humidity, wind_speed)
let wind_speed = self.wind_kmh() / 3.6;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this just = self.wind_speed();?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wind speed could be mph or m/s

Copy link
Collaborator

@MaxVerevkin MaxVerevkin Jul 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But wind_speed() is the function which you've added which always returns m/s? I think I misunderstood what these functions do. I think a few doc comments would be useful :)

@MaxVerevkin MaxVerevkin merged commit 8ea1a2a into greshake:master Jul 25, 2024
13 checks 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
Development

Successfully merging this pull request may close these issues.

3 participants