Add azimuth flip option for openmeteo/forecast.solar#3985
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an opt-in azimuth_zero_south setting for Forecast.solar and Open-Meteo PV forecast configs so users can provide azimuth values directly in the upstream API convention.
Changes:
- Gates azimuth conversion in
SolarAPIfor Forecast.solar and Open-Meteo whenazimuth_zero_southis enabled. - Adds unit coverage for converted vs unconverted azimuth URL generation.
- Updates version, example config, and documentation for the new option.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
apps/predbat/solcast.py |
Adds conditional azimuth conversion for Forecast.solar and Open-Meteo configs. |
apps/predbat/tests/test_solcast.py |
Adds Forecast.solar test coverage for azimuth_zero_south. |
apps/predbat/tests/test_open_meteo.py |
Adds Open-Meteo test coverage for azimuth_zero_south. |
apps/predbat/predbat.py |
Bumps Predbat version to v8.39.9. |
apps/predbat/config/apps.yaml |
Documents the new config key in the sample config. |
docs/install.md / docs/apps-yaml.md |
Documents the new azimuth convention option. |
Comment on lines
+706
to
+710
| om_calls = [r for r in test_api.request_log if "api.open-meteo.com" in r["url"]] | ||
| if not om_calls: | ||
| print("ERROR: No Open-Meteo API call made (azimuth_zero_south=True)") | ||
| failed = True | ||
| elif "azimuth=0" not in om_calls[0]["url"]: |
Comment on lines
309
to
+311
| az = config.get("azimuth", 180.0) | ||
| az = self.convert_azimuth(az) | ||
| if not config.get("azimuth_zero_south", False): | ||
| az = self.convert_azimuth(az) |
Comment on lines
441
to
+443
| az = config.get("azimuth", 180.0) | ||
| az = self.convert_azimuth(az) # Convert azimuth to degrees if needed | ||
| if not config.get("azimuth_zero_south", False): | ||
| az = self.convert_azimuth(az) |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
No description provided.