openclimatefix / nowcasting_datamodel

Datamodel for the nowcasting project
6 stars 6 forks source link

Add forecast latest table #2

Closed peterdudfield closed 2 years ago

peterdudfield commented 2 years ago

Detailed Description

Add latest table of forecast, which just holds the latest forecast for that given target time. This makes it easy to load, but all the history is saved in a different table

Possible Implementation

Seperate SQL table for saving latest results. Use primary key across target_datetime_utc, gsp_id

Should also update save method to save to this table too

peterdudfield commented 2 years ago

To expand a bit.

We would have a table that would just save the latest Forecast for each gsp location. We could also have a table for 'ForecastValueSQL' so only the latest forecast values are saved there. This will make loading very quick. The full historic will be saved somewhere else

peterdudfield commented 2 years ago

The forecast can write the current table and then update this table too