Add some mypy ignores
This commit is contained in:
parent
55e8092cbf
commit
7be25313a5
@ -73,9 +73,9 @@ class Hyperopt(Backtesting):
|
|||||||
|
|
||||||
# Assign loss function
|
# Assign loss function
|
||||||
if self.config.get('loss_function', 'legacy') == 'legacy':
|
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':
|
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
|
elif (self.config['loss_function'] == 'custom' and
|
||||||
hasattr(self.custom_hyperopt, 'hyperopt_loss_custom')):
|
hasattr(self.custom_hyperopt, 'hyperopt_loss_custom')):
|
||||||
self.calculate_loss = self.custom_hyperopt.hyperopt_loss_custom # type: ignore
|
self.calculate_loss = self.custom_hyperopt.hyperopt_loss_custom # type: ignore
|
||||||
|
@ -302,7 +302,7 @@ def test_loss_calculation_has_limited_profit(hyperopt_results) -> None:
|
|||||||
under = hyperopt_loss_legacy(results_under, 600)
|
under = hyperopt_loss_legacy(results_under, 600)
|
||||||
assert over < correct
|
assert over < correct
|
||||||
assert under > correct
|
assert under > correct
|
||||||
|
|
||||||
|
|
||||||
def test_sharpe_loss_prefers_higher_profits(hyperopt_results) -> None:
|
def test_sharpe_loss_prefers_higher_profits(hyperopt_results) -> None:
|
||||||
results_over = hyperopt_results.copy()
|
results_over = hyperopt_results.copy()
|
||||||
|
Loading…
Reference in New Issue
Block a user