From 471bd4d889fa2343bdc028755356ce0f212e2da7 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 1 Nov 2019 13:52:59 +0100 Subject: [PATCH] Small stylistic fixes --- freqtrade/constants.py | 1 + freqtrade/templates/sample_hyperopt_advanced.py | 4 +--- .../templates}/strategy_analysis_example.ipynb | 0 tests/test_directory_operations.py | 3 ++- 4 files changed, 4 insertions(+), 4 deletions(-) rename {user_data/notebooks => freqtrade/templates}/strategy_analysis_example.ipynb (100%) diff --git a/freqtrade/constants.py b/freqtrade/constants.py index e28016eea..96109bc94 100644 --- a/freqtrade/constants.py +++ b/freqtrade/constants.py @@ -28,6 +28,7 @@ USER_DATA_FILES = { 'sample_hyperopt_advanced.py': 'hyperopts', 'sample_hyperopt_loss.py': 'hyperopts', 'sample_hyperopt.py': 'hyperopts', + 'strategy_analysis_example.ipynb': 'notebooks', } TIMEFRAMES = [ diff --git a/freqtrade/templates/sample_hyperopt_advanced.py b/freqtrade/templates/sample_hyperopt_advanced.py index 66182edcf..7ababc16c 100644 --- a/freqtrade/templates/sample_hyperopt_advanced.py +++ b/freqtrade/templates/sample_hyperopt_advanced.py @@ -1,11 +1,9 @@ # pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement from functools import reduce -from math import exp from typing import Any, Callable, Dict, List -from datetime import datetime -import numpy as np# noqa F401 +import numpy as np # noqa F401 import talib.abstract as ta from pandas import DataFrame from skopt.space import Categorical, Dimension, Integer, Real diff --git a/user_data/notebooks/strategy_analysis_example.ipynb b/freqtrade/templates/strategy_analysis_example.ipynb similarity index 100% rename from user_data/notebooks/strategy_analysis_example.ipynb rename to freqtrade/templates/strategy_analysis_example.ipynb diff --git a/tests/test_directory_operations.py b/tests/test_directory_operations.py index a7d98795b..5c2485fc3 100644 --- a/tests/test_directory_operations.py +++ b/tests/test_directory_operations.py @@ -56,11 +56,12 @@ def test_copy_sample_files(mocker, default_conf, caplog) -> None: copymock = mocker.patch('shutil.copy', MagicMock()) copy_sample_files(Path('/tmp/bar')) - assert copymock.call_count == 4 + assert copymock.call_count == 5 assert copymock.call_args_list[0][0][1] == '/tmp/bar/strategies/sample_strategy.py' assert copymock.call_args_list[1][0][1] == '/tmp/bar/hyperopts/sample_hyperopt_advanced.py' assert copymock.call_args_list[2][0][1] == '/tmp/bar/hyperopts/sample_hyperopt_loss.py' assert copymock.call_args_list[3][0][1] == '/tmp/bar/hyperopts/sample_hyperopt.py' + assert copymock.call_args_list[4][0][1] == '/tmp/bar/notebooks/strategy_analysis_example.ipynb' def test_copy_sample_files_errors(mocker, default_conf, caplog) -> None: