Pirate-Weather / pirateweather

Code and documentation for the Pirate Weather API
Apache License 2.0
617 stars 27 forks source link

91% chance of snow on a 53-71 degree F day #205

Closed ChrisHardie closed 1 month ago

ChrisHardie commented 1 month ago

Describe the bug

For this query:

https://api.pirateweather.net/forecast/my-key/39.827290,-84.890358?exclude=minutely,hourly,flags

the daily data includes a day where the temps are 53-71 F but the precipitation type shows as snow. I know we're in a time of weird and unpredictable climate stuff but I live in the location and based on real world observation there's no chance of snowfall; I don't see the same precipitation info reflected on MerrySky or elsewhere, so I'm wondering if it's a bug with precipType in the API.

               "time": 1714449600,
                "icon": "partly-cloudy-day",
                "summary": "Partly Cloudy",
                "sunriseTime": 1714473643,
                "sunsetTime": 1714523599,
                "moonPhase": 0.72,
                "precipIntensity": 0.0075,
                "precipIntensityMax": 0.0701,
                "precipIntensityMaxTime": 1714449600,
                "precipProbability": 0.91,
                "precipAccumulation": 0.0,
                "precipType": "snow",
                "temperatureHigh": 71.33,
                "temperatureHighTime": 1714510800,
                "temperatureLow": 53.78,
                "temperatureLowTime": 1714554000,
                "apparentTemperatureHigh": 70.99,
                "apparentTemperatureHighTime": 1714507200,
                "apparentTemperatureLow": 59.52,
                "apparentTemperatureLowTime": 1714474800,
                "dewPoint": 55.94,
                "humidity": 0.76,
                "pressure": 978.25,
                "windSpeed": 6.85,
                "windGust": 10.28,
                "windGustTime": 1714449600,
                "windBearing": 271.67,
                "cloudCover": 0.5,
                "uvIndex": 7.28,
                "uvIndexTime": 1714500000,
                "visibility": 8.42,
                "temperatureMin": 59.86,
                "temperatureMinTime": 1714467600,
                "temperatureMax": 71.33,
                "temperatureMaxTime": 1714510800,
                "apparentTemperatureMin": 59.86,
                "apparentTemperatureMinTime": 1714467600,
                "apparentTemperatureMax": 70.99,
                "apparentTemperatureMaxTime": 1714507200

Expected behavior

A daily day data point without snow

Actual behavior

A daily day data point with snow

API Endpoint

Production

Location

39.827290,-84.890358

Other details

No response

Troubleshooting steps

alexander0042 commented 1 month ago

Thanks for opening this- it's 100% a bug, since when I switch the units the precipitation type changes, which is definitely shouldn't!

alexander0042 commented 1 month ago

Ok, two things here that led to an edge case (it's always an edge case!):

alexander0042 commented 1 month ago

Ok, pushed out v2.0.3 with this change, and will update the log shortly! @cloneofghosts, any thoughts on this- does it make sense to show probability for the remaining hours, or at any point throughout the day?

cloneofghosts commented 1 month ago

I think it makes sense to show the probability for the rest of the day instead of at any point. As you said most people will want to know the chance of precipitation for the rest of the day instead of the day as a whole.

cloneofghosts commented 1 month ago

@alexander0042 Having the same issue as before where I'm getting a mix of 2.0.2 and 2.0.3

jhemak commented 1 month ago

Is this change working? I am currently seeing precipProbability of 16% for day 0 (same value as it's been since 4am) but the remaining hourlies for today (10pm and 11pm) show 0%. Unless I am misreading the timestamps.

cloneofghosts commented 1 month ago

It was supposed to rain in my location during the day yesterday. When I checked the API at 10pm it was showing a precipitation probability of 0% so from what I can tell everything seems to be working.

jhemak commented 1 month ago

Thanks. My results have been looking good too for the past 10 days or so. However, right now I'm seeing 19% probability and 0 for accumulation on day 0. Does that sometimes happen or should accumulation always be >0 if probability is >0%?