Skip to content

Commit

Permalink
Merge pull request #52 from DerOetzi/forecast
Browse files Browse the repository at this point in the history
Fix datetime problem at prediction dataframe
  • Loading branch information
DerOetzi authored Mar 29, 2024
2 parents 66e6e96 + c131e64 commit a6ade3b
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 a6ade3b

Please sign in to comment.