Add HyperoptState enum and container class
This commit is contained in:
@@ -13,6 +13,7 @@ from colorama import Fore, Style
|
||||
from pandas import isna, json_normalize
|
||||
|
||||
from freqtrade.constants import FTHYPT_FILEVERSION, USERPATH_STRATEGIES
|
||||
from freqtrade.enums import HyperoptState
|
||||
from freqtrade.exceptions import OperationalException
|
||||
from freqtrade.misc import deep_merge_dicts, round_coin_value, round_dict, safe_value_fallback2
|
||||
from freqtrade.optimize.hyperopt_epoch_filters import hyperopt_filter_epochs
|
||||
@@ -32,6 +33,20 @@ def hyperopt_serializer(x):
|
||||
return str(x)
|
||||
|
||||
|
||||
class HyperoptStateContainer():
|
||||
""" Singleton class to track state of hyperopt"""
|
||||
__state = HyperoptState.OPTIMIZE
|
||||
|
||||
@classmethod
|
||||
def set_state(cls, value: HyperoptState):
|
||||
cls.__state = value
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
def state(cls) -> HyperoptState:
|
||||
return cls.__state
|
||||
|
||||
|
||||
class HyperoptTools():
|
||||
|
||||
@staticmethod
|
||||
|
Reference in New Issue
Block a user