From 0a5f8f6c5575f87a2c2be292bcc292b606386c47 Mon Sep 17 00:00:00 2001 From: Alexander Hess Date: Tue, 1 Dec 2026 11:42:34 +0100 Subject: [PATCH] Enable "warn_return_any" --- pyproject.toml | 4 ++-- src/velofy/forecasts/methods/arima.py | 2 +- src/velofy/forecasts/methods/ets.py | 2 +- src/velofy/forecasts/timify.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4a8160d..6f7ab42 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -483,8 +483,8 @@ strict_equality = true # Report `t.cast()` calls that are not needed warn_redundant_casts = true -# Allow returning `Any` as long as the ORM models' relationships are untyped -warn_return_any = false +# Report functions returning `Any` despite a non-`Any` return type +warn_return_any = true # Report "[[tool.mypy.overrides]]" sections that match no module warn_unused_configs = true diff --git a/src/velofy/forecasts/methods/arima.py b/src/velofy/forecasts/methods/arima.py index 9391063..7c09898 100644 --- a/src/velofy/forecasts/methods/arima.py +++ b/src/velofy/forecasts/methods/arima.py @@ -64,7 +64,7 @@ def predict( ) # Convert the results into a nice `pd.DataFrame` with the right `.index`. - forecasts = pandas2ri.rpy2py(result) + forecasts: pd.DataFrame = pandas2ri.rpy2py(result) forecasts.index = forecast_interval return forecasts.round(5).rename( diff --git a/src/velofy/forecasts/methods/ets.py b/src/velofy/forecasts/methods/ets.py index 58a11ad..d9691ff 100644 --- a/src/velofy/forecasts/methods/ets.py +++ b/src/velofy/forecasts/methods/ets.py @@ -65,7 +65,7 @@ def predict( ) # Convert the results into a nice `pd.DataFrame` with the right `.index`. - forecasts = pandas2ri.rpy2py(result) + forecasts: pd.DataFrame = pandas2ri.rpy2py(result) forecasts.index = forecast_interval return forecasts.round(5).rename( diff --git a/src/velofy/forecasts/timify.py b/src/velofy/forecasts/timify.py index 43119ed..bb9ab81 100644 --- a/src/velofy/forecasts/timify.py +++ b/src/velofy/forecasts/timify.py @@ -555,9 +555,9 @@ class OrderHistory: first_day = training_ts.index.min().date() last_day = training_ts.index.max().date() # `+1` as both `first_day` and `last_day` are included. - n_days = (last_day - first_day).days + 1 + 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,