Make mypy as strict as practical #13
4 changed files with 6 additions and 6 deletions
Enable "warn_return_any"
commit
0a5f8f6c55
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue