proper validation of freqai config parameters
This commit is contained in:
@@ -44,7 +44,6 @@ class FreqaiDataKitchen:
|
||||
self.data: Dict[Any, Any] = {}
|
||||
self.data_dictionary: Dict[Any, Any] = {}
|
||||
self.config = config
|
||||
self.assert_config(self.config, live)
|
||||
self.freqai_config = config["freqai"]
|
||||
self.predictions: npt.ArrayLike = np.array([])
|
||||
self.do_predict: npt.ArrayLike = np.array([])
|
||||
@@ -72,28 +71,6 @@ class FreqaiDataKitchen:
|
||||
|
||||
self.data_drawer = data_drawer
|
||||
|
||||
def assert_config(self, config: Dict[str, Any], live: bool) -> None:
|
||||
if not config.get('freqai'):
|
||||
logger.error('No Freqai parameters found in config file.')
|
||||
|
||||
# assert config.get('freqai'), "No Freqai parameters found in config file."
|
||||
# assert config.get('freqai', {}).get('train_period'), ("No Freqai train_period found in"
|
||||
# "config file.")
|
||||
# assert type(config.get('freqai', {})
|
||||
# .get('train_period')) is int, ('Can only train on full day period.'
|
||||
# 'No fractional days permitted.')
|
||||
# assert config.get('freqai', {}).get('backtest_period'), ("No Freqai backtest_period found"
|
||||
# "in config file.")
|
||||
# if not live:
|
||||
# assert type(config.get('freqai', {})
|
||||
# .get('backtest_period')) is int, ('Can only backtest on full day'
|
||||
# 'backtest_period. Only live/dry mode'
|
||||
# 'allows fractions of days')
|
||||
# assert config.get('freqai', {}).get('identifier'), ("No Freqai identifier found in config"
|
||||
# "file.")
|
||||
# assert config.get('freqai', {}).get('feature_parameters'), ("No Freqai feature_parameters"
|
||||
# "found in config file.")
|
||||
|
||||
def set_paths(self, metadata: dict, trained_timestamp: int = None,) -> None:
|
||||
self.full_path = Path(self.config['user_data_dir'] /
|
||||
"models" /
|
||||
|
@@ -13,6 +13,7 @@ from pandas import DataFrame
|
||||
|
||||
from freqtrade.configuration import TimeRange
|
||||
from freqtrade.enums import RunMode
|
||||
from freqtrade.exceptions import OperationalException
|
||||
from freqtrade.freqai.data_drawer import FreqaiDataDrawer
|
||||
from freqtrade.freqai.data_kitchen import FreqaiDataKitchen
|
||||
from freqtrade.strategy.interface import IStrategy
|
||||
@@ -57,18 +58,11 @@ class IFreqaiModel(ABC):
|
||||
self.config['exchange']['pair_whitelist'])
|
||||
|
||||
def assert_config(self, config: Dict[str, Any]) -> None:
|
||||
if not config.get('freqai'):
|
||||
logger.error('No Freqai parameters found in config file.')
|
||||
# assert config.get('freqai'), "No Freqai parameters found in config file."
|
||||
# assert config.get('freqai', {}).get('data_split_parameters'), ("No Freqai"
|
||||
# "data_split_parameters"
|
||||
# "in config file.")
|
||||
# assert config.get('freqai', {}).get('model_training_parameters'), ("No Freqai"
|
||||
# "modeltrainingparameters"
|
||||
# "found in config file.")
|
||||
# assert config.get('freqai', {}).get('feature_parameters'), ("No Freqai"
|
||||
# "feature_parameters found in"
|
||||
# "config file.")
|
||||
|
||||
if not config.get('freqai', {}):
|
||||
raise OperationalException(
|
||||
"No freqai parameters found in configuration file."
|
||||
)
|
||||
|
||||
def start(self, dataframe: DataFrame, metadata: dict, strategy: IStrategy) -> DataFrame:
|
||||
"""
|
||||
|
Reference in New Issue
Block a user