openclimatefix / pv-site-api

Site specific API for PV forecasting
5 stars 8 forks source link

Issue/compact #118

Closed peterdudfield closed 10 months ago

peterdudfield commented 10 months ago

Pull Request

Description

add options for compact on forecast and generation for lots of sites

Forecasts and generations: Take about the Same time, and 1/5 the space. This is for 35 sites, so I imagine the saving would grow for more sites. The main thing was to extract the timestamps and create index for them.

For the nowcasting and gsp api we swapped time and location, but this didnt work here as the location id, is a uuid, compared to a gsp_id

Fixes #112

How Has This Been Tested?

CI tests + tested locally

Checklist:

codecov[bot] commented 10 months ago

Codecov Report

Merging #118 (39dadcd) into main (aad1528) will increase coverage by 0.83%. Report is 1 commits behind head on main. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #118      +/-   ##
==========================================
+ Coverage   93.63%   94.46%   +0.83%     
==========================================
  Files          10       11       +1     
  Lines         471      542      +71     
==========================================
+ Hits          441      512      +71     
  Misses         30       30              
Files Changed Coverage Δ
pv_site_api/__init__.py 100.00% <100.00%> (ø)
pv_site_api/_db_helpers.py 98.63% <100.00%> (-0.28%) :arrow_down:
pv_site_api/convert.py 100.00% <100.00%> (ø)
pv_site_api/main.py 93.56% <100.00%> (+0.03%) :arrow_up:
pv_site_api/pydantic_models.py 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

peterdudfield commented 10 months ago

I'm gona push this one thorugh, but @rachel-labri-tipton and @braddf I welcome any comments. I want to put this on dev to test out