Skip to content

Commit

Permalink
Fix datetime problem at prediction dataframe
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Ott <[email protected]>
  • Loading branch information
DerOetzi committed Mar 29, 2024
1 parent 66e6e96 commit c131e64
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions solaredge2mqtt/service/forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
from sklearn.compose import ColumnTransformer
from sklearn.ensemble import HistGradientBoostingRegressor
from sklearn.inspection import permutation_importance
from sklearn.model_selection import (GridSearchCV, TimeSeriesSplit,
train_test_split)
from sklearn.model_selection import GridSearchCV, TimeSeriesSplit, train_test_split
from sklearn.pipeline import Pipeline

from solaredge2mqtt.exceptions import InvalidDataException
Expand All @@ -24,8 +23,7 @@
from solaredge2mqtt.mqtt import MQTTClient
from solaredge2mqtt.service.influxdb import InfluxDB, Point
from solaredge2mqtt.service.weather import WeatherClient
from solaredge2mqtt.settings import (LOCAL_TZ, ForecastSettings,
LocationSettings)
from solaredge2mqtt.settings import LOCAL_TZ, ForecastSettings, LocationSettings


class ForecasterType(EnumModel):
Expand Down Expand Up @@ -175,6 +173,7 @@ async def forecast_loop(self):
]

data = DataFrame(estimation_data_list)
data["time"] = data["time"].astype(f"datetime64[ns, {LOCAL_TZ}]")

for typed, forecaster in self.forecasters.items():
predicted_data = await forecaster.predict(data)
Expand Down

0 comments on commit c131e64

Please sign in to comment.