Enable "warn_return_any"

This commit is contained in:
Alexander Hess 2026-12-01 11:42:34 +01:00
commit 0a5f8f6c55
Signed by: alexander
GPG key ID: B46EDB4DFC26805D
4 changed files with 6 additions and 6 deletions

View file

@ -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

View file

@ -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(

View file

@ -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(

View file

@ -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,