From 2acb68e6e24fdb6920b89fa2992d55d7f7c91bcf Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 30 Apr 2022 13:59:23 +0200 Subject: [PATCH] Move hyperopt-loss functions to their own package --- freqtrade/optimize/{ => hyperopt_loss}/hyperopt_loss_calmar.py | 0 .../optimize/{ => hyperopt_loss}/hyperopt_loss_max_drawdown.py | 0 .../optimize/{ => hyperopt_loss}/hyperopt_loss_onlyprofit.py | 0 .../{ => hyperopt_loss}/hyperopt_loss_profit_drawdown.py | 0 freqtrade/optimize/{ => hyperopt_loss}/hyperopt_loss_sharpe.py | 0 .../optimize/{ => hyperopt_loss}/hyperopt_loss_sharpe_daily.py | 0 .../{ => hyperopt_loss}/hyperopt_loss_short_trade_dur.py | 0 freqtrade/optimize/{ => hyperopt_loss}/hyperopt_loss_sortino.py | 0 .../optimize/{ => hyperopt_loss}/hyperopt_loss_sortino_daily.py | 0 freqtrade/resolvers/hyperopt_resolver.py | 2 +- tests/optimize/test_hyperoptloss.py | 2 +- 11 files changed, 2 insertions(+), 2 deletions(-) rename freqtrade/optimize/{ => hyperopt_loss}/hyperopt_loss_calmar.py (100%) rename freqtrade/optimize/{ => hyperopt_loss}/hyperopt_loss_max_drawdown.py (100%) rename freqtrade/optimize/{ => hyperopt_loss}/hyperopt_loss_onlyprofit.py (100%) rename freqtrade/optimize/{ => hyperopt_loss}/hyperopt_loss_profit_drawdown.py (100%) rename freqtrade/optimize/{ => hyperopt_loss}/hyperopt_loss_sharpe.py (100%) rename freqtrade/optimize/{ => hyperopt_loss}/hyperopt_loss_sharpe_daily.py (100%) rename freqtrade/optimize/{ => hyperopt_loss}/hyperopt_loss_short_trade_dur.py (100%) rename freqtrade/optimize/{ => hyperopt_loss}/hyperopt_loss_sortino.py (100%) rename freqtrade/optimize/{ => hyperopt_loss}/hyperopt_loss_sortino_daily.py (100%) diff --git a/freqtrade/optimize/hyperopt_loss_calmar.py b/freqtrade/optimize/hyperopt_loss/hyperopt_loss_calmar.py similarity index 100% rename from freqtrade/optimize/hyperopt_loss_calmar.py rename to freqtrade/optimize/hyperopt_loss/hyperopt_loss_calmar.py diff --git a/freqtrade/optimize/hyperopt_loss_max_drawdown.py b/freqtrade/optimize/hyperopt_loss/hyperopt_loss_max_drawdown.py similarity index 100% rename from freqtrade/optimize/hyperopt_loss_max_drawdown.py rename to freqtrade/optimize/hyperopt_loss/hyperopt_loss_max_drawdown.py diff --git a/freqtrade/optimize/hyperopt_loss_onlyprofit.py b/freqtrade/optimize/hyperopt_loss/hyperopt_loss_onlyprofit.py similarity index 100% rename from freqtrade/optimize/hyperopt_loss_onlyprofit.py rename to freqtrade/optimize/hyperopt_loss/hyperopt_loss_onlyprofit.py diff --git a/freqtrade/optimize/hyperopt_loss_profit_drawdown.py b/freqtrade/optimize/hyperopt_loss/hyperopt_loss_profit_drawdown.py similarity index 100% rename from freqtrade/optimize/hyperopt_loss_profit_drawdown.py rename to freqtrade/optimize/hyperopt_loss/hyperopt_loss_profit_drawdown.py diff --git a/freqtrade/optimize/hyperopt_loss_sharpe.py b/freqtrade/optimize/hyperopt_loss/hyperopt_loss_sharpe.py similarity index 100% rename from freqtrade/optimize/hyperopt_loss_sharpe.py rename to freqtrade/optimize/hyperopt_loss/hyperopt_loss_sharpe.py diff --git a/freqtrade/optimize/hyperopt_loss_sharpe_daily.py b/freqtrade/optimize/hyperopt_loss/hyperopt_loss_sharpe_daily.py similarity index 100% rename from freqtrade/optimize/hyperopt_loss_sharpe_daily.py rename to freqtrade/optimize/hyperopt_loss/hyperopt_loss_sharpe_daily.py diff --git a/freqtrade/optimize/hyperopt_loss_short_trade_dur.py b/freqtrade/optimize/hyperopt_loss/hyperopt_loss_short_trade_dur.py similarity index 100% rename from freqtrade/optimize/hyperopt_loss_short_trade_dur.py rename to freqtrade/optimize/hyperopt_loss/hyperopt_loss_short_trade_dur.py diff --git a/freqtrade/optimize/hyperopt_loss_sortino.py b/freqtrade/optimize/hyperopt_loss/hyperopt_loss_sortino.py similarity index 100% rename from freqtrade/optimize/hyperopt_loss_sortino.py rename to freqtrade/optimize/hyperopt_loss/hyperopt_loss_sortino.py diff --git a/freqtrade/optimize/hyperopt_loss_sortino_daily.py b/freqtrade/optimize/hyperopt_loss/hyperopt_loss_sortino_daily.py similarity index 100% rename from freqtrade/optimize/hyperopt_loss_sortino_daily.py rename to freqtrade/optimize/hyperopt_loss/hyperopt_loss_sortino_daily.py diff --git a/freqtrade/resolvers/hyperopt_resolver.py b/freqtrade/resolvers/hyperopt_resolver.py index e3c234f60..bcfe5e1d8 100644 --- a/freqtrade/resolvers/hyperopt_resolver.py +++ b/freqtrade/resolvers/hyperopt_resolver.py @@ -23,7 +23,7 @@ class HyperOptLossResolver(IResolver): object_type = IHyperOptLoss object_type_str = "HyperoptLoss" user_subdir = USERPATH_HYPEROPTS - initial_search_path = Path(__file__).parent.parent.joinpath('optimize').resolve() + initial_search_path = Path(__file__).parent.parent.joinpath('optimize/hyperopt_loss').resolve() @staticmethod def load_hyperoptloss(config: Dict) -> IHyperOptLoss: diff --git a/tests/optimize/test_hyperoptloss.py b/tests/optimize/test_hyperoptloss.py index e3f6daf6c..4ec80ef49 100644 --- a/tests/optimize/test_hyperoptloss.py +++ b/tests/optimize/test_hyperoptloss.py @@ -4,7 +4,7 @@ from unittest.mock import MagicMock import pytest from freqtrade.exceptions import OperationalException -from freqtrade.optimize.hyperopt_loss_short_trade_dur import ShortTradeDurHyperOptLoss +from freqtrade.optimize.hyperopt_loss.hyperopt_loss_short_trade_dur import ShortTradeDurHyperOptLoss from freqtrade.resolvers.hyperopt_resolver import HyperOptLossResolver