fix: tolerate null values in open-meteo hourly forecast arrays#99
Open
bvweerd wants to merge 1 commit into
Open
fix: tolerate null values in open-meteo hourly forecast arrays#99bvweerd wants to merge 1 commit into
bvweerd wants to merge 1 commit into
Conversation
Open-meteo occasionally returns null for individual hours, typically at the forecast edge. float(None) raised TypeError, which turned the whole weather update into UpdateFailed even though the remaining 47 hours of data were perfectly usable — degrading the PV forecast (and after the stale window, raising a repair issue) until a later poll happened to return a fully populated response. Coerce null entries to 0.0 instead. A zero radiation/wind hour is a safe neutral value, and a null temperature of 0.0 cannot trigger the >25 C panel derating. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XWQRQEJXUxbp2CGFS18U9i
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Open-meteo occasionally returns
nullfor individual hours in the hourly arrays (typically at the forecast edge).float(None)raisedTypeError, which the extraction block converted intoUpdateFailedfor the whole weather update — even though the remaining ~47 hours of data were perfectly usable. Consequence: the PV forecast degrades to the previous (aging) snapshot, and afterWEATHER_STALE_AFTER_MINUTESaweather_data_stalerepair issue appears, until a later poll happens to return a fully populated response.Fix: coerce
nullentries to0.0in radiation / DNI / diffuse / wind / temperature. Zero radiation or wind is a safe neutral value for a single hour, and a null temperature mapped to 0 °C can never trigger the >25 °C panel derating. Genuinely malformed values (non-numeric strings) still raiseUpdateFailedas before.Type of change
fix:Bug fix (patch version bump)feat:New feature (minor version bump)feat!:/BREAKING CHANGE:Breaking change (major version bump)chore:/docs:/ci:Maintenance or documentation (no version bump)Checklist
feat:,fix:,chore:, etc.)devbranch (notmain, unless this is a hotfix)Screenshots / Logs (optional)
New test:
test_async_update_data_null_values_treated_as_zero.🤖 Generated with Claude Code
https://claude.ai/code/session_01XWQRQEJXUxbp2CGFS18U9i
Generated by Claude Code