Refactor hyperopt_tools naming
This commit is contained in:
parent
c65b4e5d3b
commit
d54ee0eb04
@ -67,7 +67,7 @@ def start_hyperopt_list(args: Dict[str, Any]) -> None:
|
|||||||
if epochs and not no_details:
|
if epochs and not no_details:
|
||||||
sorted_epochs = sorted(epochs, key=itemgetter('loss'))
|
sorted_epochs = sorted(epochs, key=itemgetter('loss'))
|
||||||
results = sorted_epochs[0]
|
results = sorted_epochs[0]
|
||||||
HyperoptTools.print_epoch_details(results, total_epochs, print_json, no_header)
|
HyperoptTools.show_epoch_details(results, total_epochs, print_json, no_header)
|
||||||
|
|
||||||
if epochs and export_csv:
|
if epochs and export_csv:
|
||||||
HyperoptTools.export_csv_file(
|
HyperoptTools.export_csv_file(
|
||||||
@ -132,7 +132,7 @@ def start_hyperopt_show(args: Dict[str, Any]) -> None:
|
|||||||
show_backtest_result(metrics['strategy_name'], metrics,
|
show_backtest_result(metrics['strategy_name'], metrics,
|
||||||
metrics['stake_currency'])
|
metrics['stake_currency'])
|
||||||
|
|
||||||
HyperoptTools.print_epoch_details(val, total_epochs, print_json, no_header,
|
HyperoptTools.show_epoch_details(val, total_epochs, print_json, no_header,
|
||||||
header_str="Epoch details")
|
header_str="Epoch details")
|
||||||
|
|
||||||
|
|
||||||
|
@ -469,7 +469,7 @@ class Hyperopt:
|
|||||||
f"saved to '{self.results_file}'.")
|
f"saved to '{self.results_file}'.")
|
||||||
|
|
||||||
if self.current_best_epoch:
|
if self.current_best_epoch:
|
||||||
HyperoptTools.print_epoch_details(self.current_best_epoch, self.total_epochs,
|
HyperoptTools.show_epoch_details(self.current_best_epoch, self.total_epochs,
|
||||||
self.print_json)
|
self.print_json)
|
||||||
else:
|
else:
|
||||||
# This is printed when Ctrl+C is pressed quickly, before first epochs have
|
# This is printed when Ctrl+C is pressed quickly, before first epochs have
|
||||||
|
@ -73,7 +73,7 @@ class HyperoptTools():
|
|||||||
return epochs
|
return epochs
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def print_epoch_details(results, total_epochs: int, print_json: bool,
|
def show_epoch_details(results, total_epochs: int, print_json: bool,
|
||||||
no_header: bool = False, header_str: str = None) -> None:
|
no_header: bool = False, header_str: str = None) -> None:
|
||||||
"""
|
"""
|
||||||
Display details of the hyperopt result
|
Display details of the hyperopt result
|
||||||
|
@ -1068,7 +1068,7 @@ def test_simplified_interface_failed(mocker, hyperopt_conf, method, space) -> No
|
|||||||
hyperopt.start()
|
hyperopt.start()
|
||||||
|
|
||||||
|
|
||||||
def test_print_epoch_details(capsys):
|
def test_show_epoch_details(capsys):
|
||||||
test_result = {
|
test_result = {
|
||||||
'params_details': {
|
'params_details': {
|
||||||
'trailing': {
|
'trailing': {
|
||||||
@ -1090,7 +1090,7 @@ def test_print_epoch_details(capsys):
|
|||||||
'is_best': True
|
'is_best': True
|
||||||
}
|
}
|
||||||
|
|
||||||
HyperoptTools.print_epoch_details(test_result, 5, False, no_header=True)
|
HyperoptTools.show_epoch_details(test_result, 5, False, no_header=True)
|
||||||
captured = capsys.readouterr()
|
captured = capsys.readouterr()
|
||||||
assert '# Trailing stop:' in captured.out
|
assert '# Trailing stop:' in captured.out
|
||||||
# re.match(r"Pairs for .*", captured.out)
|
# re.match(r"Pairs for .*", captured.out)
|
||||||
|
Loading…
Reference in New Issue
Block a user