openclimatefix / uk-pv-national-xg

National PV forecasting using Gradient Boosted Methods.
4 stars 3 forks source link

add method to save data to database #7

Closed peterdudfield closed 1 year ago

peterdudfield commented 1 year ago

Model should produce a dataframe with the following columns -- target_datetime_utc -- forecast_kw

We need a function to change the into ForecastSQL object - https://github.com/openclimatefix/nowcasting_datamodel/blob/main/nowcasting_datamodel/models/forecast.py#L316

then we can use 'save' method from here https://github.com/openclimatefix/nowcasting_datamodel/blob/main/nowcasting_datamodel/save.py#L18 we can first set update_national = False, so that it doesnt over write the current PVnet model

Test add test to run app and see if results are saved in the database

peterdudfield commented 1 year ago

Maybe @thomasarmstrong98 you could have a go at this, once you are happy with the app

peterdudfield commented 1 year ago

Keep this open until it is merged into main