Move optimize_commands to commands module

This commit is contained in:
Matthias 2020-01-26 13:32:52 +01:00
parent b254bdfea3
commit e033df6a2f

View File

@ -2,14 +2,14 @@ import logging
from typing import Any, Dict from typing import Any, Dict
from freqtrade import constants from freqtrade import constants
from freqtrade.commands.utils import setup_utils_configuration
from freqtrade.exceptions import DependencyException, OperationalException from freqtrade.exceptions import DependencyException, OperationalException
from freqtrade.state import RunMode from freqtrade.state import RunMode
from freqtrade.commands import setup_utils_configuration
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
def setup_configuration(args: Dict[str, Any], method: RunMode) -> Dict[str, Any]: def setup_optimize_configuration(args: Dict[str, Any], method: RunMode) -> Dict[str, Any]:
""" """
Prepare the configuration for the Hyperopt module Prepare the configuration for the Hyperopt module
:param args: Cli args from Arguments() :param args: Cli args from Arguments()
@ -35,7 +35,7 @@ def start_backtesting(args: Dict[str, Any]) -> None:
from freqtrade.optimize.backtesting import Backtesting from freqtrade.optimize.backtesting import Backtesting
# Initialize configuration # Initialize configuration
config = setup_configuration(args, RunMode.BACKTEST) config = setup_optimize_configuration(args, RunMode.BACKTEST)
logger.info('Starting freqtrade in Backtesting mode') logger.info('Starting freqtrade in Backtesting mode')
@ -58,7 +58,7 @@ def start_hyperopt(args: Dict[str, Any]) -> None:
raise OperationalException( raise OperationalException(
f"{e}. Please ensure that the hyperopt dependencies are installed.") from e f"{e}. Please ensure that the hyperopt dependencies are installed.") from e
# Initialize configuration # Initialize configuration
config = setup_configuration(args, RunMode.HYPEROPT) config = setup_optimize_configuration(args, RunMode.HYPEROPT)
logger.info('Starting freqtrade in Hyperopt mode') logger.info('Starting freqtrade in Hyperopt mode')
@ -94,7 +94,7 @@ def start_edge(args: Dict[str, Any]) -> None:
""" """
from freqtrade.optimize.edge_cli import EdgeCli from freqtrade.optimize.edge_cli import EdgeCli
# Initialize configuration # Initialize configuration
config = setup_configuration(args, RunMode.EDGE) config = setup_optimize_configuration(args, RunMode.EDGE)
logger.info('Starting freqtrade in Edge mode') logger.info('Starting freqtrade in Edge mode')
# Initialize Edge object # Initialize Edge object