From 25d2768d8facff573c74fe21b9314a169d94cfc8 Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Wed, 23 Oct 2024 17:04:00 +0100 Subject: [PATCH] fix for pv no data, format to string --- india_forecast_app/models/pvnet/model.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/india_forecast_app/models/pvnet/model.py b/india_forecast_app/models/pvnet/model.py index cc96202..8f5f538 100644 --- a/india_forecast_app/models/pvnet/model.py +++ b/india_forecast_app/models/pvnet/model.py @@ -276,7 +276,8 @@ def _prepare_data_sources(self): # if generation_da is still empty make nans if len(generation_da) == 0: - generation_df = pd.DataFrame(index=forecast_timesteps, columns=["0"], data=0.0001) + cols = [str(col) for col in self.generation_data["data"].columns] + generation_df = pd.DataFrame(index=forecast_timesteps, columns=cols, data=0.0001) generation_da = generation_df.to_xarray() generation_da.to_netcdf(pv_netcdf_path, engine="h5netcdf")