openclimatefix / pv-site-api

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

Pivot return object on time #112

Closed peterdudfield closed 10 months ago

peterdudfield commented 10 months ago

Detailed Description

We should try pivoting the return object, to return by time

Context

Possible Implementation

[ {time: 'xxxx',
locations: [ 
                  {'forecast_mw:1.2, 
                   'forecast_per', 
                    'site_uuid':1, 
                   { 'forecast_mw:1.2, 
                     'forecast_per', gsp_id:2}
},
{}.]
peterdudfield commented 10 months ago

Changes from Screenshot 2023-08-30 at 17 24 21

to

Screenshot 2023-08-30 at 17 24 37

For 26 sites

Time goes from ~6s to 6s Size goes from 5.3MB to 437KB

Note 4 seconds is dont by searching through sites, and seeing if the user has access to them #116