From 7be25313a5447b8000c51f07216bb2c29af44dc6 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 15 Jul 2019 22:59:28 +0200 Subject: [PATCH] Add some mypy ignores --- freqtrade/optimize/hyperopt.py | 4 ++-- freqtrade/tests/optimize/test_hyperopt.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/freqtrade/optimize/hyperopt.py b/freqtrade/optimize/hyperopt.py index 929debc86..bf5b70e14 100644 --- a/freqtrade/optimize/hyperopt.py +++ b/freqtrade/optimize/hyperopt.py @@ -73,9 +73,9 @@ class Hyperopt(Backtesting): # Assign loss function if self.config.get('loss_function', 'legacy') == 'legacy': - self.calculate_loss = hyperopt_loss_legacy + self.calculate_loss = hyperopt_loss_legacy # type: ignore elif self.config.get('loss_function', 'sharpe') == 'sharpe': - self.calculate_loss = hyperopt_loss_sharpe + self.calculate_loss = hyperopt_loss_sharpe # type: ignore elif (self.config['loss_function'] == 'custom' and hasattr(self.custom_hyperopt, 'hyperopt_loss_custom')): self.calculate_loss = self.custom_hyperopt.hyperopt_loss_custom # type: ignore diff --git a/freqtrade/tests/optimize/test_hyperopt.py b/freqtrade/tests/optimize/test_hyperopt.py index 88d7de39c..aae3405ad 100644 --- a/freqtrade/tests/optimize/test_hyperopt.py +++ b/freqtrade/tests/optimize/test_hyperopt.py @@ -302,7 +302,7 @@ def test_loss_calculation_has_limited_profit(hyperopt_results) -> None: under = hyperopt_loss_legacy(results_under, 600) assert over < correct assert under > correct - + def test_sharpe_loss_prefers_higher_profits(hyperopt_results) -> None: results_over = hyperopt_results.copy()