fix hyperopt - freqai

This commit is contained in:
Wagner Costa Santos
2022-09-05 17:43:28 -03:00
parent 9fb3517adc
commit 5b826150df
2 changed files with 31 additions and 5 deletions

View File

@@ -90,6 +90,13 @@ class IFreqaiModel(ABC):
self._threads: List[threading.Thread] = []
self._stop_event = threading.Event()
def __getstate__(self):
"""
Return state values to be pickled.
It's necessary to allow serialization in hyperopt
"""
return ({"dd": self.dd})
def assert_config(self, config: Dict[str, Any]) -> None:
if not config.get("freqai", {}):