Upgrade pandas

Also, replace the deprecated "T" frequency alias with "min",
and access the trend by position with `.iloc`.
This commit is contained in:
Alexander Hess 2026-11-25 13:08:32 +01:00
commit 705955b38b
Signed by: alexander
GPG key ID: B46EDB4DFC26805D
2 changed files with 105 additions and 85 deletions

View file

@ -50,8 +50,8 @@ def predict(
# Create a point forecast by linear extrapolation
# for one or even more time steps ahead.
slope = trend[-1] - trend[-2]
prediction = trend[-1] + slope
slope = trend.iloc[-1] - trend.iloc[-2]
prediction = trend.iloc[-1] + slope
idx = observations.index.max() + seasonal_lag
while idx <= forecast_interval.max():
if idx in forecast_interval:

View file

@ -162,7 +162,7 @@ class OrderHistory:
gen = (
(pixel_id, start_at)
for pixel_id in sorted(data.index.levels[0])
for start_at in pd.date_range(start, end, freq=f'{self._time_step}T')
for start_at in pd.date_range(start, end, freq=f'{self._time_step}min')
if config.SERVICE_START <= start_at.hour < config.SERVICE_END
)