Skip to content

feat: implements per-site time series and clearsky for sites_v1 - #399

Open
suvanbanerjee wants to merge 11 commits into
feat/sites-v1-crudfrom
feat/per-site-v1
Open

suvanbanerjee wants to merge 11 commits into
feat/sites-v1-crudfrom
feat/per-site-v1

Conversation

@suvanbanerjee

@suvanbanerjee suvanbanerjee commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Pull Request

Description

Implements per-site time series for Sites v1

Four routes, all under /v1/{country}/{source}/sites/:

Route Returns
GET /{site_id}/forecast predicted power from the platform
GET /{site_id}/generation observed power the customer reported
POST /{site_id}/generation customer uploads readings → 202, no body
GET /{site_id}/clearsky cloudless-day estimate, pure pvlib, no platform call
GET /clearsky the same for up to 10 sites, one shared times_utc

Note

Default Observer and Forecaster Check the vals and behavior of defaults and confirm them once

A site with no forecast is 200 with values: []

capacity_kW is the site's own capacity, not the values'. A stored 0 means
deactivated or not yet commissioned, and must read as such rather than as "no data".

How Has This Been Tested?

  • against the dev DP

Known Issue, not fixed here

Newly created sites can return a 404 when requesting their forecast immediately, because the DP checks whether the site existed at the start of the requested window.

The same happens when requesting history from before the site was created. These should return an empty list instead. This may be an issue in DP, so it has not been worked around in the api.
cc @devsjc

Related - openclimatefix/client-private#573

Checklist:

  • My code follows OCF's coding style guidelines
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked my code and corrected any misspellings

@suvanbanerjee
suvanbanerjee added this pull request to stack #397 September 21, 2026 10:07
@suvanbanerjee suvanbanerjee changed the title feat: add clearsky single and matrix feat: implements per-site time series and clearsky for sites_v1 Sep 23, 2026
@suvanbanerjee
suvanbanerjee marked this pull request as ready for review September 23, 2026 11:19
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.

1 participant