Improve mypy runs

This commit is contained in:
Matthias 2022-04-23 11:31:12 +02:00
parent 1120392f39
commit f2912f8815
3 changed files with 5 additions and 4 deletions

View File

@ -290,7 +290,7 @@ class Hyperopt:
self.assign_params(params_dict, 'protection')
if HyperoptTools.has_space(self.config, 'roi'):
self.backtesting.strategy.minimal_roi = ( # type: ignore
self.backtesting.strategy.minimal_roi = (
self.custom_hyperopt.generate_roi_table(params_dict))
if HyperoptTools.has_space(self.config, 'stoploss'):
@ -465,8 +465,8 @@ class Hyperopt:
# We don't need exchange instance anymore while running hyperopt
self.backtesting.exchange.close()
self.backtesting.exchange._api = None # type: ignore
self.backtesting.exchange._api_async = None # type: ignore
self.backtesting.exchange._api = None
self.backtesting.exchange._api_async = None
self.backtesting.exchange.loop = None # type: ignore
# self.backtesting.exchange = None # type: ignore
self.backtesting.pairlists = None # type: ignore

View File

@ -264,7 +264,7 @@ def generate_edge_table(results: dict) -> str:
# Ignore type as floatfmt does allow tuples but mypy does not know that
return tabulate(tabular_data, headers=headers,
floatfmt=floatfmt, tablefmt="orgtbl", stralign="right") # type: ignore
floatfmt=floatfmt, tablefmt="orgtbl", stralign="right")
def _get_resample_from_period(period: str) -> str:

View File

@ -52,6 +52,7 @@ exclude =
[mypy]
ignore_missing_imports = True
warn_unused_ignores = True
[mypy-tests.*]
ignore_errors = True