From f92fd35ce359416aa693a3a8cd7c55053820c6b9 Mon Sep 17 00:00:00 2001 From: Alexander Hess Date: Tue, 1 Dec 2026 15:31:58 +0100 Subject: [PATCH] Revert to bare `pd.Series` in `OrderHistory` `typeguard` evaluates the annotations at runtime where `pd.Series[int]` raises a `TypeError` --- src/velofy/forecasts/timify.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/velofy/forecasts/timify.py b/src/velofy/forecasts/timify.py index cc49669..bb9ab81 100644 --- a/src/velofy/forecasts/timify.py +++ b/src/velofy/forecasts/timify.py @@ -255,7 +255,7 @@ class OrderHistory: pixel_id: int, predict_at: dt.datetime, train_horizon: int, - ) -> tuple["pd.Series[int]", int, "pd.Series[int]"]: + ) -> tuple[pd.Series, int, pd.Series]: """Slice a horizontal time series out of the `.totals`. Create a time series covering `train_horizon` weeks that can be used @@ -331,7 +331,7 @@ class OrderHistory: pixel_id: int, predict_day: dt.date, train_horizon: int, - ) -> tuple["pd.Series[int]", int, "pd.Series[int]"]: + ) -> tuple[pd.Series, int, pd.Series]: """Slice a vertical time series out of the `.totals`. Create a time series covering `train_horizon` weeks that can be used @@ -424,7 +424,7 @@ class OrderHistory: pixel_id: int, predict_at: dt.datetime, train_horizon: int, - ) -> tuple["pd.Series[int]", int, "pd.Series[int]"]: + ) -> tuple[pd.Series, int, pd.Series]: """Slice a vertical real-time time series out of the `.totals`. Create a time series covering `train_horizon` weeks that can be used @@ -557,7 +557,7 @@ class OrderHistory: # `+1` as both `first_day` and `last_day` are included. n_days: int = (last_day - first_day).days + 1 - return round(training_ts.sum() / n_days, 1) + return round(float(training_ts.sum()) / n_days, 1) def choose_tactical_model( self,