Skip to content

Commit

Permalink
Refactor hyperopt_tools naming
Browse files Browse the repository at this point in the history
  • Loading branch information
xmatthias committed Jun 13, 2021
1 parent c65b4e5 commit d54ee0e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions freqtrade/commands/hyperopt_commands.py
Expand Up @@ -67,7 +67,7 @@ def start_hyperopt_list(args: Dict[str, Any]) -> None:
if epochs and not no_details:
sorted_epochs = sorted(epochs, key=itemgetter('loss'))
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:
HyperoptTools.export_csv_file(
Expand Down Expand Up @@ -132,8 +132,8 @@ def start_hyperopt_show(args: Dict[str, Any]) -> None:
show_backtest_result(metrics['strategy_name'], metrics,
metrics['stake_currency'])

HyperoptTools.print_epoch_details(val, total_epochs, print_json, no_header,
header_str="Epoch details")
HyperoptTools.show_epoch_details(val, total_epochs, print_json, no_header,
header_str="Epoch details")


def hyperopt_filter_epochs(epochs: List, filteroptions: dict) -> List:
Expand Down
4 changes: 2 additions & 2 deletions freqtrade/optimize/hyperopt.py
Expand Up @@ -469,8 +469,8 @@ def start(self) -> None:
f"saved to '{self.results_file}'.")

if self.current_best_epoch:
HyperoptTools.print_epoch_details(self.current_best_epoch, self.total_epochs,
self.print_json)
HyperoptTools.show_epoch_details(self.current_best_epoch, self.total_epochs,
self.print_json)
else:
# This is printed when Ctrl+C is pressed quickly, before first epochs have
# a chance to be evaluated.
Expand Down
4 changes: 2 additions & 2 deletions freqtrade/optimize/hyperopt_tools.py
Expand Up @@ -73,8 +73,8 @@ def load_previous_results(results_file: Path) -> List:
return epochs

@staticmethod
def print_epoch_details(results, total_epochs: int, print_json: bool,
no_header: bool = False, header_str: str = None) -> None:
def show_epoch_details(results, total_epochs: int, print_json: bool,
no_header: bool = False, header_str: str = None) -> None:
"""
Display details of the hyperopt result
"""
Expand Down
4 changes: 2 additions & 2 deletions tests/optimize/test_hyperopt.py
Expand Up @@ -1068,7 +1068,7 @@ def test_simplified_interface_failed(mocker, hyperopt_conf, method, space) -> No
hyperopt.start()


def test_print_epoch_details(capsys):
def test_show_epoch_details(capsys):
test_result = {
'params_details': {
'trailing': {
Expand All @@ -1090,7 +1090,7 @@ def test_print_epoch_details(capsys):
'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()
assert '# Trailing stop:' in captured.out
# re.match(r"Pairs for .*", captured.out)
Expand Down

0 comments on commit d54ee0e

Please sign in to comment.