Make mypy as strict as practical #13

Merged
alexander merged 32 commits from stricter-mypy into develop 2026-12-01 14:26:52 +01:00
Showing only changes of commit 081d6f7fd9 - Show all commits

Type the time series of OrderHistory as pd.Series[int]
All checks were successful
CI / Checks (Python 3.13) (push) Successful in 1m55s

Alexander Hess 2026-12-01 14:23:14 +01:00
Signed by: alexander
GPG key ID: B46EDB4DFC26805D

View file

@ -255,7 +255,7 @@ class OrderHistory:
pixel_id: int,
predict_at: dt.datetime,
train_horizon: int,
) -> tuple[pd.Series, int, pd.Series]:
) -> tuple["pd.Series[int]", int, "pd.Series[int]"]:
"""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, pd.Series]:
) -> tuple["pd.Series[int]", int, "pd.Series[int]"]:
"""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, pd.Series]:
) -> tuple["pd.Series[int]", int, "pd.Series[int]"]:
"""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(float(training_ts.sum()) / n_days, 1)
return round(training_ts.sum() / n_days, 1)
def choose_tactical_model(
self,