mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-06 17:31:53 +00:00
Check prediction feature flag when entering crypto/pred
This commit is contained in:
@@ -437,28 +437,34 @@ class CryptoController(CryptoBaseController):
|
||||
@log_start_end(log=logger)
|
||||
def call_pred(self, _):
|
||||
"""Process pred command"""
|
||||
if self.coin:
|
||||
try:
|
||||
from gamestonk_terminal.cryptocurrency.prediction_techniques import (
|
||||
pred_controller,
|
||||
)
|
||||
|
||||
if self.current_interval != "1day":
|
||||
console.print("Only interval `1day` is possible for now.\n")
|
||||
else:
|
||||
self.queue = self.load_class(
|
||||
pred_controller.PredictionTechniquesController,
|
||||
self.coin,
|
||||
self.current_df,
|
||||
self.queue,
|
||||
if gtff.ENABLE_PREDICT:
|
||||
if self.coin:
|
||||
try:
|
||||
from gamestonk_terminal.cryptocurrency.prediction_techniques import (
|
||||
pred_controller,
|
||||
)
|
||||
except ImportError:
|
||||
logger.exception("Tensorflow not available")
|
||||
console.print("[red]Run pip install tensorflow to continue[/red]\n")
|
||||
|
||||
if self.current_interval != "1day":
|
||||
console.print("Only interval `1day` is possible for now.\n")
|
||||
else:
|
||||
self.queue = self.load_class(
|
||||
pred_controller.PredictionTechniquesController,
|
||||
self.coin,
|
||||
self.current_df,
|
||||
self.queue,
|
||||
)
|
||||
except ImportError:
|
||||
logger.exception("Tensorflow not available")
|
||||
console.print("[red]Run pip install tensorflow to continue[/red]\n")
|
||||
|
||||
else:
|
||||
console.print(
|
||||
"No coin selected. Use 'load' to load the coin you want to look at.\n"
|
||||
)
|
||||
else:
|
||||
console.print(
|
||||
"No coin selected. Use 'load' to load the coin you want to look at.\n"
|
||||
"Predict is disabled. Check ENABLE_PREDICT flag on feature_flags.py",
|
||||
"\n",
|
||||
)
|
||||
|
||||
@log_start_end(log=logger)
|
||||
|
||||
Reference in New Issue
Block a user