{"id":20200944,"url":"https://github.com/openclimatefix/uk-pv-forecast-blend","last_synced_at":"2025-04-10T11:22:15.928Z","repository":{"id":187705183,"uuid":"676464815","full_name":"openclimatefix/uk-pv-forecast-blend","owner":"openclimatefix","description":"Service to blend forecast together","archived":false,"fork":false,"pushed_at":"2025-03-27T14:29:19.000Z","size":232,"stargazers_count":2,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T15:25:07.078Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openclimatefix.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["openclimatefix"],"patreon":null,"open_collective":"openclimatefix","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2023-08-09T09:01:55.000Z","updated_at":"2025-03-27T09:50:22.000Z","dependencies_parsed_at":"2023-08-11T21:04:44.499Z","dependency_job_id":"14d979ca-2293-4e8c-9b37-581912ddc43a","html_url":"https://github.com/openclimatefix/uk-pv-forecast-blend","commit_stats":{"total_commits":64,"total_committers":2,"mean_commits":32.0,"dds":0.328125,"last_synced_commit":"4f63d5c3eecbbf738eda945f285b6117577fac2d"},"previous_names":["openclimatefix/uk-pv-forecast-blend"],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openclimatefix%2Fuk-pv-forecast-blend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openclimatefix%2Fuk-pv-forecast-blend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openclimatefix%2Fuk-pv-forecast-blend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openclimatefix%2Fuk-pv-forecast-blend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openclimatefix","download_url":"https://codeload.github.com/openclimatefix/uk-pv-forecast-blend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248208604,"owners_count":21065203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T04:46:17.541Z","updated_at":"2025-04-10T11:22:15.923Z","avatar_url":"https://github.com/openclimatefix.png","language":"Python","funding_links":["https://github.com/sponsors/openclimatefix","https://opencollective.com/openclimatefix"],"categories":[],"sub_categories":[],"readme":"# UK PV Forecast Blend\n\nThis app is for blending forecast together\n\nThe main application (forecast_blend/app.py)\n1. Loads different forecasts \n2. Blends them together using weights\n3. Saves them ready to be used by the api\n4. This is done for all GSPs\n\nThis was previously done in the API\n\nWe always update the ForecastValueLatest table, \nbut we only update the ForecastValue table every 30 minutes\n\n# Details\n\n- Note we only blend forecasts if they are made within 6 hours. \nIf all forecasts are older than this, then all forecasts are used.\n- The probabilistic forecasts are now blended using the same method as the expected value\n- We current take `Pvnet`, then blend it with `PVnet DA`. `PVnet ECMWF` is used as a backup, and final `National-xg` is a final backup. \n\n```mermaid\n  graph TD;\n      subgraph App\n      S(Start) --\u003e LF\n      LF(Load All Forecasts);\n      LF --\u003e Filter(Filter Forecasts);\n      Filter --\u003e  Blend[Blend \\n Expected values];\n      Blend --\u003e N4(Blend Probabilistic \\n- only for National);\n      N4 --\u003e S(Save Forecast)\n      S --\u003e F(Finish)\n      end\n      \n      subgraph Blending\n    A(All Forecasts);\n    W2(Weights);\n    A --\u003e SUT(Split unique 'target times' \\n and not);\n    SUT --\u003e |Unique Target times| B\n    SUT --\u003e |Duplicated Target times| C(Loop over each \\n target time)\n    C --\u003e BW\n    W2 --\u003e BW\n    BW(Blend using weights) --\u003e SumCheck\n    SumCheck{At least one \\n forecast available} --\u003e |yes| B\n    SumCheck --\u003e |no| Blend2(Blend forecast with \\n next set of weights)\n    Blend2 --\u003e SumCheck2\n    SumCheck2{At least one \\n forecast available} --\u003e |yes| B\n    SumCheck2 --\u003e |no| BB(Break)\n    B(Blended \\n Forecast)\n    end\n```\n\n## Environment Variables\n\n- `DB_URL`: The database url you want to save the results to\n- `N_GSP`: The number of gsps you want to pull. N_GSP=1 means only National is run. \n\n# Tests\n\nTests are in the tests folder and can be run using pytest\n\nMight need to \n```\nexport PYTHONPATH=${PYTHONPATH}:./forecast_blend\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenclimatefix%2Fuk-pv-forecast-blend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenclimatefix%2Fuk-pv-forecast-blend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenclimatefix%2Fuk-pv-forecast-blend/lists"}