Cleaned out pred remenants (#2743)

* Cleaned out pred remenants

* Added more cleaning
This commit is contained in:
Colin Delahunty
2022-10-08 22:06:29 +02:00
committed by GitHub
parent b51576118e
commit e0c5a199e6
7 changed files with 5 additions and 108 deletions

1
i18n/en.yml vendored
View File

@@ -32,7 +32,6 @@ en:
featflags/cls: clear console after each command
featflags/color: use coloring features
featflags/promptkit: enable prompt toolkit (autocomplete and history)
featflags/predict: prediction features
featflags/thoughts: thoughts of the day
featflags/reporthtml: open report as HTML otherwise notebook
featflags/exithelp: automatically print help when quitting menu

View File

@@ -387,45 +387,6 @@ class CryptoController(CryptoBaseController):
self.queue,
)
@log_start_end(log=logger)
def call_pred(self, _):
"""Process pred command"""
# IMPORTANT: 8/11/22 prediction was discontinued on the installer packages
# because forecasting in coming out soon.
# This if statement disallows installer package users from using 'pred'
# even if they turn on the OPENBB_ENABLE_PREDICT feature flag to true
# however it does not prevent users who clone the repo from using it
# if they have ENABLE_PREDICT set to true.
if obbff.PACKAGED_APPLICATION or not obbff.ENABLE_PREDICT:
console.print(
"Predict is disabled. Forecasting coming soon!",
"\n",
)
else:
if self.symbol:
try:
from openbb_terminal.cryptocurrency.prediction_techniques import (
pred_controller,
)
if self.current_interval != "1440":
console.print("Only interval `1day` is possible for now.\n")
else:
self.queue = self.load_class(
pred_controller.PredictionTechniquesController,
self.symbol,
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"
)
@log_start_end(log=logger)
def call_onchain(self, _):
"""Process onchain command"""

View File

@@ -1576,62 +1576,13 @@ class EconomyController(BaseController):
# # after saving it and displaying it to the user
os.remove(self.d_GROUPS[ns_group] + ".jpg")
@log_start_end(log=logger)
def call_pred(self, _):
"""Process pred command"""
# IMPORTANT: 8/11/22 prediction was discontinued on the installer packages
# because forecasting in coming out soon.
# This if statement disallows installer package users from using 'pred'
# even if they turn on the OPENBB_ENABLE_PREDICT feature flag to true
# however it does not prevent users who clone the repo from using it
# if they have ENABLE_PREDICT set to true.
if obbff.PACKAGED_APPLICATION or not obbff.ENABLE_PREDICT:
console.print(
"Predict is disabled. Forecasting coming soon!",
"\n",
)
else:
if not self.DATASETS:
console.print(
"There is no data stored yet. Please use either the 'macro', 'fred', 'index' and/or "
"'treasury' command in combination with the -st argument to be able to plot data.\n"
)
return
data: Dict = {}
all_datasets_empty = True
for source, _ in self.DATASETS.items():
if not self.DATASETS[source].empty:
all_datasets_empty = False
if len(self.DATASETS[source].columns) == 1:
data[self.DATASETS[source].columns[0]] = self.DATASETS[source]
else:
for col in list(self.DATASETS[source].columns):
data[col] = self.DATASETS[source][col].to_frame()
if all_datasets_empty:
console.print(
"There is no data stored yet. Please use either the 'macro', 'fred', 'index' and/or "
"'treasury' command in combination with the -st argument to be able to plot data.\n"
)
return
from openbb_terminal.economy.prediction.pred_controller import (
PredictionTechniquesController,
)
self.queue = self.load_class(
PredictionTechniquesController, data, self.queue
)
@log_start_end(log=logger)
def call_qa(self, _):
"""Process qa command"""
if not self.DATASETS:
console.print(
"There is no data stored yet. Please use either the 'macro', 'fred', 'index' and/or "
"'treasury' command in combination with the -st argument to be able to plot data.\n"
"There is no data stored. Please use either the 'macro', 'fred', 'index' and/or "
"'treasury' command in combination with the -st argument to plot data.\n"
)
return

View File

@@ -34,7 +34,6 @@ class FeatureFlagsController(BaseController):
"watermark",
"cmdloc",
"promptkit",
"predict",
"thoughts",
"reporthtml",
"exithelp",
@@ -63,7 +62,6 @@ class FeatureFlagsController(BaseController):
mt.add_setting("cls", obbff.USE_CLEAR_AFTER_CMD)
mt.add_setting("color", obbff.USE_COLOR)
mt.add_setting("promptkit", obbff.USE_PROMPT_TOOLKIT)
mt.add_setting("predict", obbff.ENABLE_PREDICT)
mt.add_setting("thoughts", obbff.ENABLE_THOUGHTS_DAY)
mt.add_setting("reporthtml", obbff.OPEN_REPORT_AS_HTML)
mt.add_setting("exithelp", obbff.ENABLE_EXIT_AUTO_HELP)
@@ -123,13 +121,6 @@ class FeatureFlagsController(BaseController):
)
console.print("")
@log_start_end(log=logger)
def call_predict(self, _):
"""Process predict command"""
obbff.ENABLE_PREDICT = not obbff.ENABLE_PREDICT
set_key(obbff.USER_ENV_FILE, "OPENBB_ENABLE_PREDICT", str(obbff.ENABLE_PREDICT))
console.print("")
@log_start_end(log=logger)
def call_thoughts(self, _):
"""Process thoughts command"""

View File

@@ -62,9 +62,6 @@ USE_CMD_LOCATION_FIGURE = strtobool(os.getenv("OPENBB_USE_CMD_LOCATION_FIGURE",
# Enable Prompt Toolkit
USE_PROMPT_TOOLKIT = strtobool(os.getenv("OPENBB_USE_PROMPT_TOOLKIT", "True"))
# Enable Prediction features
ENABLE_PREDICT = strtobool(os.getenv("OPENBB_ENABLE_PREDICT", "True"))
# Enable plot autoscaling
USE_PLOT_AUTOSCALING = strtobool(os.getenv("OPENBB_USE_PLOT_AUTOSCALING", "False"))

View File

@@ -126,8 +126,6 @@ def open_openbb_documentation(
path = "terminal/common/ba/"
elif "qa" in path:
path = "terminal/common/qa/"
elif "pred" in path:
path = "terminal/common/pred/"
elif "keys" in path:
path = "#accessing-other-sources-of-data-via-api-keys"
command = ""
@@ -138,7 +136,7 @@ def open_openbb_documentation(
path = f"terminal/{path}"
if command:
if command in ["ta", "ba", "qa", "pred"]:
if command in ["ta", "ba", "qa"]:
path = "terminal/common/"
elif "keys" == command:
path = "#accessing-other-sources-of-data-via-api-keys"

View File

@@ -769,7 +769,6 @@ def log_settings() -> None:
settings_dict["cls"] = "True" if obbff.USE_CLEAR_AFTER_CMD else "False"
settings_dict["color"] = "True" if obbff.USE_COLOR else "False"
settings_dict["promptkit"] = "True" if obbff.USE_PROMPT_TOOLKIT else "False"
settings_dict["predict"] = "True" if obbff.ENABLE_PREDICT else "False"
settings_dict["thoughts"] = "True" if obbff.ENABLE_THOUGHTS_DAY else "False"
settings_dict["reporthtml"] = "True" if obbff.OPEN_REPORT_AS_HTML else "False"
settings_dict["exithelp"] = "True" if obbff.ENABLE_EXIT_AUTO_HELP else "False"
@@ -806,7 +805,8 @@ def run_scripts(
verbose : bool
Whether to run tests in verbose mode
routines_args : List[str]
One or multiple inputs to be replaced in the routine and separated by commas. E.g. GME,AMC,BTC-USD
One or multiple inputs to be replaced in the routine and separated by commas.
E.g. GME,AMC,BTC-USD
"""
if os.path.isfile(path):
with open(path) as fp: