Remove encode/decode for hyperopt

This commit is contained in:
Matthias 2021-05-01 17:01:52 +02:00
parent cf03daa0fd
commit 30da307d13
3 changed files with 2 additions and 9 deletions

View File

@ -1,11 +1,6 @@
""" Freqtrade bot """
__version__ = 'develop'
import locale
def getpreferredencoding(do_setlocale=True):
return "utf-8"
locale.getpreferredencoding = getpreferredencoding
if __version__ == 'develop':
try:

View File

@ -4,7 +4,6 @@
This module contains the hyperopt logic
"""
import locale
import logging
import random
import warnings
@ -354,7 +353,7 @@ class Hyperopt:
f"Total profit {results_metrics['total_profit']: 11.8f} {stake_cur} "
f"({results_metrics['profit']: 7.2f}\N{GREEK CAPITAL LETTER SIGMA}%). "
f"Avg duration {results_metrics['duration']:5.1f} min."
).encode(locale.getpreferredencoding(), 'replace').decode('utf-8')
)
def get_optimizer(self, dimensions: List[Dimension], cpu_count) -> Optimizer:
return Optimizer(

View File

@ -1,5 +1,4 @@
# pragma pylint: disable=missing-docstring,W0212,C0103
import locale
import logging
import re
from datetime import datetime
@ -631,7 +630,7 @@ def test_generate_optimizer(mocker, hyperopt_conf) -> None:
'Avg profit 2.31%. Median profit 2.31%. Total profit '
'0.00023300 BTC ( 2.31\N{GREEK CAPITAL LETTER SIGMA}%). '
'Avg duration 100.0 min.'
).encode(locale.getpreferredencoding(), 'replace').decode('utf-8'),
),
'params_details': {'buy': {'adx-enabled': False,
'adx-value': 0,
'fastd-enabled': True,