From 8b7010fc9a98aa20f38bd71c6861b19d351c61f9 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 15 Jun 2021 20:15:20 +0200 Subject: [PATCH] Update pprint name --- freqtrade/optimize/hyperopt_tools.py | 4 ++-- tests/optimize/test_hyperopttools.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/freqtrade/optimize/hyperopt_tools.py b/freqtrade/optimize/hyperopt_tools.py index 0d17a5d13..7b14440fc 100755 --- a/freqtrade/optimize/hyperopt_tools.py +++ b/freqtrade/optimize/hyperopt_tools.py @@ -186,7 +186,7 @@ class HyperoptTools(): # Buy / sell parameters no_params = HyperoptTools._space_params(non_optimized, space, 5) - result += f"{space}_params = {HyperoptTools._pprint(space_params, no_params)}" + result += f"{space}_params = {HyperoptTools.__pprint_dict(space_params, no_params)}" result = result.replace("\n", "\n ") print(result) @@ -200,7 +200,7 @@ class HyperoptTools(): return {} @staticmethod - def _pprint(params, non_optimized, indent: int = 4): + def __pprint_dict(params, non_optimized, indent: int = 4): """ Pretty-print hyperopt results (based on 2 dicts - with add. comment) """ diff --git a/tests/optimize/test_hyperopttools.py b/tests/optimize/test_hyperopttools.py index 7eb18e432..69c7073c0 100644 --- a/tests/optimize/test_hyperopttools.py +++ b/tests/optimize/test_hyperopttools.py @@ -133,11 +133,11 @@ def test_show_epoch_details(capsys): assert re.search(r'^\s+\"90\"\:\s0.14,\s*$', captured.out, re.MULTILINE) -def test___pprint(): +def test___pprint_dict(): params = {'buy_std': 1.2, 'buy_rsi': 31, 'buy_enable': True, 'buy_what': 'asdf'} non_params = {'buy_notoptimied': 55} - x = HyperoptTools._pprint(params, non_params) + x = HyperoptTools.__pprint_dict(params, non_params) assert x == """{ "buy_std": 1.2, "buy_rsi": 31, @@ -171,7 +171,7 @@ def test_export_params(tmpdir): }, "roi": { "0": 0.528, - "346": 0.08499999999999999, + "346": 0.08499, "507": 0.049, "1595": 0 }