fix(deps): upgrade pandas to 3.1 and fix EOS deprecations (#1469)

* build(deps): bump pandas from 3.0.6 to 3.1.0

* fix(prediction): avoid pandas 3.1 deprecation warnings
This commit is contained in:
Normann
2026-10-29 09:10:21 +01:00
committed by GitHub
parent dfc62d7e9c
commit 8396bf24ae
11 changed files with 128 additions and 69 deletions
@@ -149,7 +149,7 @@ class ElecPriceAkkudoktor(ElecPriceProvider):
price_wh = value.marketpriceEurocentPerKWh / (100 * 1000)
# Collect all values into the Pandas Series
prices_wh.at[orig_datetime] = price_wh
prices_wh.loc[(orig_datetime,)] = price_wh
if not highest_orig_datetime: # mypy fix
error_msg = f"Highest original datetime not available: {highest_orig_datetime}"
@@ -245,7 +245,7 @@ class ElecPriceEnergyCharts(ElecPriceProvider):
price_wh = price_eur_per_mwh / 1_000_000
# Store in series
prices_wh.at[orig_datetime] = price_wh
prices_wh.loc[(orig_datetime,)] = price_wh
# Always raw here — fees are applied once, later, over the complete
# raw+predicted series in _store_gross_series().
@@ -301,7 +301,7 @@ class ElecPriceTibber(ElecPriceProvider):
series_data = pd.Series(dtype=float)
for point in points:
orig_datetime = to_datetime(point.startsAt, in_timezone=self.config.general.timezone)
series_data.at[orig_datetime] = point.total / 1000.0
series_data.loc[(orig_datetime,)] = point.total / 1000.0
return series_data.sort_index()
@@ -92,7 +92,7 @@ class FeedInTariffAkkudoktor(FeedInTariffProvider):
series = pd.Series(dtype=float)
for value in data.values:
timestamp = to_datetime(value.start, in_timezone=self.config.general.timezone)
series.at[timestamp] = value.marketprice / 1_000_000
series.loc[(timestamp,)] = value.marketprice / 1_000_000
return series
async def _update_data(self, force_update: Optional[bool] = False) -> None:
@@ -111,7 +111,7 @@ class FeedInTariffDvhubOnline(FeedInTariffProvider):
except (KeyError, TypeError, ValueError) as exc:
logger.warning("Skipping malformed dvhub.online price entry {}: {}", entry, exc)
continue
series_data.at[orig_datetime] = price_eur_per_mwh / 1_000_000
series_data.loc[(orig_datetime,)] = price_eur_per_mwh / 1_000_000
return series_data
async def _update_data(self, force_update: Optional[bool] = False) -> None:
@@ -180,7 +180,7 @@ class FeedInTariffEnergyCharts(FeedInTariffProvider):
price_wh = price_eur_per_mwh / 1_000_000
# Store in series
prices_wh.at[orig_datetime] = price_wh
prices_wh.loc[(orig_datetime,)] = price_wh
# Always raw here — fees are applied once, later, over the complete
# raw+predicted series in _store_gross_series().
@@ -98,7 +98,7 @@ class FeedInTariffTibber(FeedInTariffProvider):
if point.energy is None:
raise ValueError("Tibber response does not contain the energy price component")
timestamp = to_datetime(point.startsAt, in_timezone=self.config.general.timezone)
series.at[timestamp] = point.energy / 1000.0
series.loc[(timestamp,)] = point.energy / 1000.0
if series.empty:
raise ValueError("Tibber response contains no feed-in price points")
+1 -1
View File
@@ -280,7 +280,7 @@ def Prediction(eos_host: str, eos_port: Union[str, int], data: Optional[dict] =
# Merge into dataframe
# ---------------------------------------------------------------------
predictions = pd.concat(series_list, axis=1).reset_index()
predictions.rename(columns={"index": "date_time"}, inplace=True)
predictions = predictions.rename(columns={"index": "date_time"})
# Remove time offset from UTC to get naive local time and make bokeh plot in local time
date_time_tz = predictions["date_time"].dt.tz