Update pprint name

This commit is contained in:
Matthias 2021-06-15 20:15:20 +02:00
parent aa5181ca81
commit 8b7010fc9a
2 changed files with 5 additions and 5 deletions

View File

@ -186,7 +186,7 @@ class HyperoptTools():
# Buy / sell parameters # Buy / sell parameters
no_params = HyperoptTools._space_params(non_optimized, space, 5) 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 ") result = result.replace("\n", "\n ")
print(result) print(result)
@ -200,7 +200,7 @@ class HyperoptTools():
return {} return {}
@staticmethod @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) Pretty-print hyperopt results (based on 2 dicts - with add. comment)
""" """

View File

@ -133,11 +133,11 @@ def test_show_epoch_details(capsys):
assert re.search(r'^\s+\"90\"\:\s0.14,\s*$', captured.out, re.MULTILINE) 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'} params = {'buy_std': 1.2, 'buy_rsi': 31, 'buy_enable': True, 'buy_what': 'asdf'}
non_params = {'buy_notoptimied': 55} non_params = {'buy_notoptimied': 55}
x = HyperoptTools._pprint(params, non_params) x = HyperoptTools.__pprint_dict(params, non_params)
assert x == """{ assert x == """{
"buy_std": 1.2, "buy_std": 1.2,
"buy_rsi": 31, "buy_rsi": 31,
@ -171,7 +171,7 @@ def test_export_params(tmpdir):
}, },
"roi": { "roi": {
"0": 0.528, "0": 0.528,
"346": 0.08499999999999999, "346": 0.08499,
"507": 0.049, "507": 0.049,
"1595": 0 "1595": 0
} }