From 7eb62ed32e7acc7004821a9213c7752fe31f1f9c Mon Sep 17 00:00:00 2001 From: Fredrik81 Date: Mon, 24 Feb 2020 00:33:01 +0100 Subject: [PATCH] Remove old print option for hyperopt-list and made table as default --- docs/utils.md | 1 - freqtrade/commands/arguments.py | 3 +-- freqtrade/commands/cli_options.py | 6 ------ freqtrade/commands/hyperopt_commands.py | 23 +++++------------------ freqtrade/configuration/configuration.py | 3 --- tests/commands/test_commands.py | 16 ---------------- 6 files changed, 6 insertions(+), 46 deletions(-) diff --git a/docs/utils.md b/docs/utils.md index 6ca0b7920..abb7fd0db 100644 --- a/docs/utils.md +++ b/docs/utils.md @@ -440,7 +440,6 @@ optional arguments: --no-color Disable colorization of hyperopt results. May be useful if you are redirecting output to a file. --print-json Print best result detailization in JSON format. - --print-table Print results in table format. --no-details Do not print best epoch details. Common arguments: diff --git a/freqtrade/commands/arguments.py b/freqtrade/commands/arguments.py index 0f6478a60..fe6f49039 100644 --- a/freqtrade/commands/arguments.py +++ b/freqtrade/commands/arguments.py @@ -66,8 +66,7 @@ ARGS_HYPEROPT_LIST = ["hyperopt_list_best", "hyperopt_list_profitable", "hyperopt_list_min_avg_time", "hyperopt_list_max_avg_time", "hyperopt_list_min_avg_profit", "hyperopt_list_max_avg_profit", "hyperopt_list_min_total_profit", "hyperopt_list_max_total_profit", - "print_colorized", "print_json", "print_table", - "hyperopt_list_no_details"] + "print_colorized", "print_json", "hyperopt_list_no_details"] ARGS_HYPEROPT_SHOW = ["hyperopt_list_best", "hyperopt_list_profitable", "hyperopt_show_index", "print_json", "hyperopt_show_no_header"] diff --git a/freqtrade/commands/cli_options.py b/freqtrade/commands/cli_options.py index 9efc1151a..1776955b1 100644 --- a/freqtrade/commands/cli_options.py +++ b/freqtrade/commands/cli_options.py @@ -220,12 +220,6 @@ AVAILABLE_CLI_OPTIONS = { action='store_true', default=False, ), - "print_table": Arg( - '--print-table', - help='Print results in table format.', - action='store_true', - default=False, - ), "hyperopt_jobs": Arg( '-j', '--job-workers', help='The number of concurrently running jobs for hyperoptimization ' diff --git a/freqtrade/commands/hyperopt_commands.py b/freqtrade/commands/hyperopt_commands.py index 88cd79468..ccaa59e54 100755 --- a/freqtrade/commands/hyperopt_commands.py +++ b/freqtrade/commands/hyperopt_commands.py @@ -21,7 +21,6 @@ def start_hyperopt_list(args: Dict[str, Any]) -> None: print_colorized = config.get('print_colorized', False) print_json = config.get('print_json', False) - print_table = config.get('print_table', False) no_details = config.get('hyperopt_list_no_details', False) no_header = False @@ -47,26 +46,14 @@ def start_hyperopt_list(args: Dict[str, Any]) -> None: trials = _hyperopt_filter_trials(trials, filteroptions) - # TODO: fetch the interval for epochs to print from the cli option - epoch_start, epoch_stop = 0, None - if print_colorized: colorama_init(autoreset=True) - if print_table: - try: - Hyperopt.print_result_table(config, trials, total_epochs, - not filteroptions['only_best'], print_colorized) - except KeyboardInterrupt: - print('User interrupted..') - else: - try: - # Human-friendly indexes used here (starting from 1) - for val in trials[epoch_start:epoch_stop]: - Hyperopt.print_results_explanation(val, total_epochs, - not filteroptions['only_best'], print_colorized) - except KeyboardInterrupt: - print('User interrupted..') + try: + Hyperopt.print_result_table(config, trials, total_epochs, + not filteroptions['only_best'], print_colorized) + except KeyboardInterrupt: + print('User interrupted..') if trials and not no_details: sorted_trials = sorted(trials, key=itemgetter('loss')) diff --git a/freqtrade/configuration/configuration.py b/freqtrade/configuration/configuration.py index 0adfe03e7..c2613ba99 100644 --- a/freqtrade/configuration/configuration.py +++ b/freqtrade/configuration/configuration.py @@ -286,9 +286,6 @@ class Configuration: self._args_to_config(config, argname='print_json', logstring='Parameter --print-json detected ...') - self._args_to_config(config, argname='print_table', - logstring='Parameter --print-table detected: {}') - self._args_to_config(config, argname='hyperopt_jobs', logstring='Parameter -j/--job-workers detected: {}') diff --git a/tests/commands/test_commands.py b/tests/commands/test_commands.py index ceae6f372..995b504c5 100644 --- a/tests/commands/test_commands.py +++ b/tests/commands/test_commands.py @@ -907,22 +907,6 @@ def test_hyperopt_list(mocker, capsys, hyperopt_results): assert all(x not in captured.out for x in [" 1/12", " 3/12", " 4/12", " 5/12", " 7/12", " 8/12" " 9/12", " 10/12", " 11/12", " 12/12"]) - args = [ - "hyperopt-list", - "--no-details", - "--print-table", - "--min-trades", "100", - "--print-json" - ] - pargs = get_args(args) - pargs['config'] = None - start_hyperopt_list(pargs) - captured = capsys.readouterr() - assert all(x in captured.out - for x in [" 3/12", " 7/12", " 9/12", " 11/12"]) - assert all(x not in captured.out - for x in [" 1/12", " 2/12", " 4/12", " 5/12", " 6/12", " 8/12", " 10/12" - " 12/12"]) def test_hyperopt_show(mocker, capsys, hyperopt_results):