diff --git a/README.md b/README.md index ad5fa5e278f..68f54389d0d 100644 --- a/README.md +++ b/README.md @@ -136,9 +136,9 @@ Note: The libraries specified in the [requirements.txt](/requirements.txt) file *If you would like to use optional Machine Learning features:* -* Update your [config_terminal.py](/gamestonk_terminal/config_terminal.py) with: +* Update your [feature_flags.py](/gamestonk_terminal/feature_flags.py) with: ``` -ENABLE_PREDICT = False +ENABLE_PREDICT = os.getenv("GTFF_ENABLE_PREDICT") or True ``` * Install optional ML features dependencies collection with poetry: diff --git a/gamestonk_terminal/config_terminal.py b/gamestonk_terminal/config_terminal.py index e02768d8794..f1b8757890d 100644 --- a/gamestonk_terminal/config_terminal.py +++ b/gamestonk_terminal/config_terminal.py @@ -25,9 +25,3 @@ API_POLYGON_KEY = os.getenv("GT_API_POLYGON_KEY") or "REPLACE_ME" API_TWITTER_KEY = os.getenv("GT_API_TWITTER_KEY") or "REPLACE_ME" API_TWITTER_SECRET_KEY = os.getenv("GT_API_TWITTER_SECRET_KEY") or "REPLACE_ME" API_TWITTER_BEARER_TOKEN = os.getenv("GT_API_TWITTER_BEARER_TOKEN") or "REPLACE_ME" - -USE_COLOR = True -USE_FLAIR = "stars" - -# Enable Prediction features -ENABLE_PREDICT = False diff --git a/gamestonk_terminal/discovery/ark_api.py b/gamestonk_terminal/discovery/ark_api.py index e40b4c7c4ec..be086cae07f 100644 --- a/gamestonk_terminal/discovery/ark_api.py +++ b/gamestonk_terminal/discovery/ark_api.py @@ -15,7 +15,7 @@ from gamestonk_terminal.helper_funcs import ( patch_pandas_text_adjustment, parse_known_args_and_warn, ) -from gamestonk_terminal.config_terminal import USE_COLOR +from gamestonk_terminal import feature_flags as gtff def direction_color_red_green(val: str) -> str: @@ -119,7 +119,7 @@ def ark_orders(l_args): pd.set_option("mode.chained_assignment", None) df_orders = add_order_total(df_orders.head(ns_parser.n_num)) - if USE_COLOR: + if gtff.USE_COLOR: df_orders["direction"] = df_orders["direction"].apply(direction_color_red_green) patch_pandas_text_adjustment() diff --git a/gamestonk_terminal/discovery/disc_menu.py b/gamestonk_terminal/discovery/disc_menu.py index 8be4ba75111..e968bf11277 100644 --- a/gamestonk_terminal/discovery/disc_menu.py +++ b/gamestonk_terminal/discovery/disc_menu.py @@ -12,6 +12,7 @@ from gamestonk_terminal.discovery import ( unusual_whales_api, yahoo_finance_api, ) +from gamestonk_terminal import feature_flags as gtff from gamestonk_terminal.helper_funcs import get_flair from gamestonk_terminal.menu import session from prompt_toolkit.completion import NestedCompleter @@ -74,7 +75,7 @@ def disc_menu(): # Loop forever and ever while True: # Get input command from user - if session: + if session and gtff.USE_PROMPT_TOOLKIT: as_input = session.prompt( f"{get_flair()} (disc)> ", completer=completer, diff --git a/gamestonk_terminal/discovery/fidelity_api.py b/gamestonk_terminal/discovery/fidelity_api.py index 13c37e534a6..cf81fecedd8 100644 --- a/gamestonk_terminal/discovery/fidelity_api.py +++ b/gamestonk_terminal/discovery/fidelity_api.py @@ -11,7 +11,7 @@ from gamestonk_terminal.helper_funcs import ( patch_pandas_text_adjustment, parse_known_args_and_warn, ) -from gamestonk_terminal.config_terminal import USE_COLOR +from gamestonk_terminal import feature_flags as gtff def buy_sell_ratio_color_red_green(val: str) -> str: @@ -137,7 +137,7 @@ def orders(l_args): pd.set_option("display.max_colwidth", None) - if USE_COLOR: + if gtff.USE_COLOR: df_orders["Buy / Sell Ratio"] = df_orders["Buy / Sell Ratio"].apply( buy_sell_ratio_color_red_green ) diff --git a/gamestonk_terminal/due_diligence/dd_menu.py b/gamestonk_terminal/due_diligence/dd_menu.py index d6998d84399..ffc27b8193f 100644 --- a/gamestonk_terminal/due_diligence/dd_menu.py +++ b/gamestonk_terminal/due_diligence/dd_menu.py @@ -6,6 +6,7 @@ from gamestonk_terminal.due_diligence import finviz_api as fvz_api from gamestonk_terminal.due_diligence import market_watch_api as mw_api from gamestonk_terminal.due_diligence import quandl_api as q_api from gamestonk_terminal.due_diligence import reddit_api as r_api +from gamestonk_terminal import feature_flags as gtff from gamestonk_terminal.helper_funcs import get_flair from gamestonk_terminal.menu import session from prompt_toolkit.completion import NestedCompleter @@ -74,7 +75,7 @@ def dd_menu(df_stock, s_ticker, s_start, s_interval): # Loop forever and ever while True: # Get input command from user - if session: + if session and gtff.USE_PROMPT_TOOLKIT: as_input = session.prompt( f"{get_flair()} (dd)> ", completer=completer, diff --git a/gamestonk_terminal/feature_flags.py b/gamestonk_terminal/feature_flags.py new file mode 100755 index 00000000000..b7fc8f051f3 --- /dev/null +++ b/gamestonk_terminal/feature_flags.py @@ -0,0 +1,9 @@ +import os + +USE_COLOR = os.getenv("GTFF_USE_COLOR") or True +USE_FLAIR = os.getenv("GTFF_USE_FLAIR") or "stars" +USE_ION = os.getenv("GTFF_USE_ION") or True +USE_PROMPT_TOOLKIT = os.getenv("GTFF_USE_PROMPT_TOOLKIT") or False + +# Enable Prediction features +ENABLE_PREDICT = os.getenv("GTFF_ENABLE_PREDICT") or False diff --git a/gamestonk_terminal/helper_funcs.py b/gamestonk_terminal/helper_funcs.py index 6aa14fe6d1e..137c419f793 100644 --- a/gamestonk_terminal/helper_funcs.py +++ b/gamestonk_terminal/helper_funcs.py @@ -12,7 +12,7 @@ import pandas as pd import pandas.io.formats.format from pandas._config.config import get_option from pandas.plotting import register_matplotlib_converters -from gamestonk_terminal import config_terminal as cfg +from gamestonk_terminal import feature_flags as gtff register_matplotlib_converters() @@ -53,6 +53,10 @@ def plot_view_stock(df, symbol): plt.grid(b=True, which="major", color="#666666", linestyle="-") plt.minorticks_on() plt.grid(b=True, which="minor", color="#999999", linestyle="-", alpha=0.2) + + if gtff.USE_ION: + plt.ion() + plt.show() print("") @@ -349,7 +353,7 @@ def get_flair() -> str: "yy": "(☯)", } - if flair.get(cfg.USE_FLAIR): - return flair[cfg.USE_FLAIR] + if flair.get(gtff.USE_FLAIR): + return flair[gtff.USE_FLAIR] return "" diff --git a/gamestonk_terminal/prediction_techniques/arima.py b/gamestonk_terminal/prediction_techniques/arima.py index d582b07c2f6..a860a5ab00a 100644 --- a/gamestonk_terminal/prediction_techniques/arima.py +++ b/gamestonk_terminal/prediction_techniques/arima.py @@ -11,6 +11,8 @@ from gamestonk_terminal.helper_funcs import ( print_pretty_prediction, ) +from gamestonk_terminal import feature_flags as gtff + register_matplotlib_converters() @@ -150,7 +152,10 @@ def arima(l_args, s_ticker, df_stock): plt.vlines( df_stock.index[-1], ymin, ymax, linewidth=1, linestyle="--", color="k" ) - plt.ion() + + if gtff.USE_ION: + plt.ion() + plt.show() # Print prediction data diff --git a/gamestonk_terminal/prediction_techniques/ets.py b/gamestonk_terminal/prediction_techniques/ets.py index c0dc5256b70..9f15c595217 100644 --- a/gamestonk_terminal/prediction_techniques/ets.py +++ b/gamestonk_terminal/prediction_techniques/ets.py @@ -11,6 +11,8 @@ from gamestonk_terminal.helper_funcs import ( print_pretty_prediction, ) +from gamestonk_terminal import feature_flags as gtff + register_matplotlib_converters() trend = "Ad" # Additive damped, A Additive, N None @@ -165,7 +167,10 @@ def exponential_smoothing(l_args, s_ticker, df_stock): linestyle="--", color="k", ) - plt.ion() + + if gtff.USE_ION: + plt.ion() + plt.show() # Print prediction data diff --git a/gamestonk_terminal/prediction_techniques/fbprophet.py b/gamestonk_terminal/prediction_techniques/fbprophet.py index 4082905ab8c..8b8549988d8 100644 --- a/gamestonk_terminal/prediction_techniques/fbprophet.py +++ b/gamestonk_terminal/prediction_techniques/fbprophet.py @@ -10,6 +10,8 @@ from gamestonk_terminal.helper_funcs import ( parse_known_args_and_warn, ) +from gamestonk_terminal import feature_flags as gtff + register_matplotlib_converters() warnings.simplefilter("ignore") @@ -81,7 +83,10 @@ def fbprophet(l_args, s_ticker, df_stock): df_stock["ds"].values[0], get_next_stock_market_days(l_pred_days[-1], 1)[-1] ) plt.title(f"Fb Prophet on {s_ticker} - {ns_parser.n_days} days prediction") - plt.ion() + + if gtff.USE_ION: + plt.ion() + plt.show() print("") diff --git a/gamestonk_terminal/prediction_techniques/knn.py b/gamestonk_terminal/prediction_techniques/knn.py index ade01ace900..b2a9ccb90e5 100644 --- a/gamestonk_terminal/prediction_techniques/knn.py +++ b/gamestonk_terminal/prediction_techniques/knn.py @@ -11,6 +11,8 @@ from gamestonk_terminal.helper_funcs import ( print_pretty_prediction, ) +from gamestonk_terminal import feature_flags as gtff + register_matplotlib_converters() @@ -118,7 +120,10 @@ def k_nearest_neighbors(l_args, s_ticker, df_stock): plt.vlines( df_stock.index[-1], ymin, ymax, linewidth=1, linestyle="--", color="k" ) - plt.ion() + + if gtff.USE_ION: + plt.ion() + plt.show() # Print prediction data diff --git a/gamestonk_terminal/prediction_techniques/neural_networks.py b/gamestonk_terminal/prediction_techniques/neural_networks.py index f736e92f050..3d63b8e266d 100644 --- a/gamestonk_terminal/prediction_techniques/neural_networks.py +++ b/gamestonk_terminal/prediction_techniques/neural_networks.py @@ -17,6 +17,8 @@ from gamestonk_terminal.helper_funcs import ( print_pretty_prediction, ) +from gamestonk_terminal import feature_flags as gtff + from gamestonk_terminal import config_neural_network_models as cfg_nn_models @@ -253,7 +255,10 @@ def mlp(l_args, s_ticker, df_stock): linestyle="--", color="k", ) - plt.ion() + + if gtff.USE_ION: + plt.ion() + plt.show() # Print prediction data @@ -443,7 +448,10 @@ def rnn(l_args, s_ticker, df_stock): linestyle="--", color="k", ) - plt.ion() + + if gtff.USE_ION: + plt.ion() + plt.show() # Print prediction data @@ -633,7 +641,10 @@ def lstm(l_args, s_ticker, df_stock): linestyle="--", color="k", ) - plt.ion() + + if gtff.USE_ION: + plt.ion() + plt.show() # Print prediction data diff --git a/gamestonk_terminal/prediction_techniques/pred_menu.py b/gamestonk_terminal/prediction_techniques/pred_menu.py index dc9f350abf1..f1a5dbd3800 100644 --- a/gamestonk_terminal/prediction_techniques/pred_menu.py +++ b/gamestonk_terminal/prediction_techniques/pred_menu.py @@ -1,6 +1,7 @@ import argparse import matplotlib.pyplot as plt +from gamestonk_terminal import feature_flags as gtff from gamestonk_terminal.helper_funcs import get_flair from gamestonk_terminal.menu import session from gamestonk_terminal.prediction_techniques import ( @@ -74,7 +75,7 @@ def pred_menu(df_stock, s_ticker, s_start, s_interval): # Loop forever and ever while True: # Get input command from user - if session: + if session and gtff.USE_PROMPT_TOOLKIT: as_input = session.prompt( f"{get_flair()} (pred)> ", completer=completer, diff --git a/gamestonk_terminal/prediction_techniques/regression.py b/gamestonk_terminal/prediction_techniques/regression.py index 48fc7040a4b..5aa4a8e3f35 100644 --- a/gamestonk_terminal/prediction_techniques/regression.py +++ b/gamestonk_terminal/prediction_techniques/regression.py @@ -14,6 +14,8 @@ from gamestonk_terminal.helper_funcs import ( print_pretty_prediction, ) +from gamestonk_terminal import feature_flags as gtff + register_matplotlib_converters() USER_INPUT = 0 @@ -137,7 +139,10 @@ def regression(l_args, s_ticker, df_stock, polynomial): plt.vlines( df_stock.index[-1], ymin, ymax, linewidth=1, linestyle="--", color="k" ) - plt.ion() + + if gtff.USE_ION: + plt.ion() + plt.show() # Print prediction data diff --git a/gamestonk_terminal/prediction_techniques/sma.py b/gamestonk_terminal/prediction_techniques/sma.py index 27ec9eee2b9..2f3c9d72aaf 100644 --- a/gamestonk_terminal/prediction_techniques/sma.py +++ b/gamestonk_terminal/prediction_techniques/sma.py @@ -11,6 +11,8 @@ from gamestonk_terminal.helper_funcs import ( print_pretty_prediction, ) +from gamestonk_terminal import feature_flags as gtff + register_matplotlib_converters() @@ -101,7 +103,10 @@ def simple_moving_average(l_args, s_ticker, df_stock): plt.vlines( df_stock.index[-1], ymin, ymax, linewidth=1, linestyle="--", color="k" ) - plt.ion() + + if gtff.USE_ION: + plt.ion() + plt.show() # Print prediction data diff --git a/gamestonk_terminal/sentiment/sen_menu.py b/gamestonk_terminal/sentiment/sen_menu.py index caaf22659ed..369c74f69b4 100644 --- a/gamestonk_terminal/sentiment/sen_menu.py +++ b/gamestonk_terminal/sentiment/sen_menu.py @@ -1,6 +1,6 @@ import argparse -from gamestonk_terminal import config_terminal as cfg +from gamestonk_terminal import feature_flags as gtff from gamestonk_terminal.helper_funcs import get_flair from gamestonk_terminal.menu import session from gamestonk_terminal.sentiment import google_api, reddit_api, stocktwits_api @@ -78,7 +78,7 @@ def sen_menu(s_ticker, s_start): # Loop forever and ever while True: # Get input command from user - if session: + if session and gtff.USE_PROMPT_TOOLKIT: as_input = session.prompt( f"{get_flair()} (sen)> ", completer=completer, @@ -136,7 +136,7 @@ def sen_menu(s_ticker, s_start): # ----------------------------------------------------- TWITTER ------------------------------------------------- elif ns_known_args.cmd == "infer": - if not cfg.ENABLE_PREDICT: + if not gtff.ENABLE_PREDICT: print("Predict is not enabled in config_terminal.py") print("Twitter inference menu is disabled") print("") @@ -159,7 +159,7 @@ def sen_menu(s_ticker, s_start): twitter_api.inference(l_args, s_ticker) elif ns_known_args.cmd == "sentiment": - if not cfg.ENABLE_PREDICT: + if not gtff.ENABLE_PREDICT: print("Predict is not enabled in config_terminal.py") print("Twitter sentiment menu is disabled") print("") diff --git a/gamestonk_terminal/technical_analysis/momentum.py b/gamestonk_terminal/technical_analysis/momentum.py index bbc7067df2e..b68ef0fa898 100644 --- a/gamestonk_terminal/technical_analysis/momentum.py +++ b/gamestonk_terminal/technical_analysis/momentum.py @@ -3,6 +3,7 @@ import matplotlib.pyplot as plt import pandas_ta as ta from pandas.plotting import register_matplotlib_converters from gamestonk_terminal.helper_funcs import check_positive, parse_known_args_and_warn +from gamestonk_terminal import feature_flags as gtff register_matplotlib_converters() @@ -101,7 +102,10 @@ def cci(l_args, s_ticker, s_interval, df_stock): plt.gca().twinx() plt.ylim(plt.gca().get_ylim()) plt.yticks([0.2, 0.8], ("OVERSOLD", "OVERBOUGHT")) - plt.ion() + + if gtff.USE_ION: + plt.ion() + plt.show() print("") @@ -217,7 +221,10 @@ def macd(l_args, s_ticker, s_interval, df_stock): plt.minorticks_on() plt.grid(b=True, which="minor", color="#999999", linestyle="-", alpha=0.2) plt.xlabel("Time") - plt.ion() + + if gtff.USE_ION: + plt.ion() + plt.show() print("") @@ -328,7 +335,10 @@ def rsi(l_args, s_ticker, s_interval, df_stock): plt.gca().twinx() plt.ylim(plt.gca().get_ylim()) plt.yticks([0.15, 0.85], ("OVERSOLD", "OVERBOUGHT")) - plt.ion() + + if gtff.USE_ION: + plt.ion() + plt.show() print("") @@ -446,7 +456,10 @@ def stoch(l_args, s_ticker, s_interval, df_stock): plt.gca().twinx() plt.ylim(plt.gca().get_ylim()) plt.yticks([0.1, 0.9], ("OVERSOLD", "OVERBOUGHT")) - plt.ion() + + if gtff.USE_ION: + plt.ion() + plt.show() print("") diff --git a/gamestonk_terminal/technical_analysis/overlap.py b/gamestonk_terminal/technical_analysis/overlap.py index c87fc25c8db..6ca6a5e33d3 100644 --- a/gamestonk_terminal/technical_analysis/overlap.py +++ b/gamestonk_terminal/technical_analysis/overlap.py @@ -3,6 +3,7 @@ import matplotlib.pyplot as plt import pandas_ta as ta from pandas.plotting import register_matplotlib_converters from gamestonk_terminal.helper_funcs import check_positive, parse_known_args_and_warn +from gamestonk_terminal import feature_flags as gtff register_matplotlib_converters() @@ -96,7 +97,10 @@ def ema(l_args, s_ticker, s_interval, df_stock): plt.grid(b=True, which="major", color="#666666", linestyle="-") plt.minorticks_on() plt.grid(b=True, which="minor", color="#999999", linestyle="-", alpha=0.2) - plt.ion() + + if gtff.USE_ION: + plt.ion() + plt.show() print("") @@ -171,7 +175,10 @@ def sma(l_args, s_ticker, s_interval, df_stock): plt.grid(b=True, which="major", color="#666666", linestyle="-") plt.minorticks_on() plt.grid(b=True, which="minor", color="#999999", linestyle="-", alpha=0.2) - plt.ion() + + if gtff.USE_ION: + plt.ion() + plt.show() print("") @@ -257,7 +264,10 @@ def vwap(l_args, s_ticker, s_interval, df_stock): plt.grid(b=True, which="major", color="#666666", linestyle="-") plt.minorticks_on() plt.grid(b=True, which="minor", color="#999999", linestyle="-", alpha=0.2) - plt.ion() + + if gtff.USE_ION: + plt.ion() + plt.show() print("") diff --git a/gamestonk_terminal/technical_analysis/ta_menu.py b/gamestonk_terminal/technical_analysis/ta_menu.py index ccf02be777e..f3a99ff2c7d 100644 --- a/gamestonk_terminal/technical_analysis/ta_menu.py +++ b/gamestonk_terminal/technical_analysis/ta_menu.py @@ -1,6 +1,7 @@ import argparse import matplotlib.pyplot as plt +from gamestonk_terminal import feature_flags as gtff from gamestonk_terminal.helper_funcs import get_flair from gamestonk_terminal.menu import session from gamestonk_terminal.technical_analysis import momentum as ta_momentum @@ -74,7 +75,7 @@ def ta_menu(df_stock, s_ticker, s_start, s_interval): # Loop forever and ever while True: # Get input command from user - if session: + if session and gtff.USE_PROMPT_TOOLKIT: as_input = session.prompt( f"{get_flair()} (ta)> ", completer=completer, diff --git a/gamestonk_terminal/technical_analysis/trend.py b/gamestonk_terminal/technical_analysis/trend.py index 7bb72507800..28689f7941c 100644 --- a/gamestonk_terminal/technical_analysis/trend.py +++ b/gamestonk_terminal/technical_analysis/trend.py @@ -3,6 +3,7 @@ import matplotlib.pyplot as plt import pandas_ta as ta from pandas.plotting import register_matplotlib_converters from gamestonk_terminal.helper_funcs import check_positive, parse_known_args_and_warn +from gamestonk_terminal import feature_flags as gtff register_matplotlib_converters() @@ -121,7 +122,10 @@ def plot_adx(df_stock, s_ticker, df_ta): plt.minorticks_on() plt.grid(b=True, which="minor", color="#999999", linestyle="-", alpha=0.2) plt.ylim([0, 100]) - plt.ion() + + if gtff.USE_ION: + plt.ion() + plt.show() @@ -221,7 +225,10 @@ def aroon(l_args, s_ticker, s_interval, df_stock): plt.minorticks_on() plt.grid(b=True, which="minor", color="#999999", linestyle="-", alpha=0.2) plt.ylim([-100, 100]) - plt.ion() + + if gtff.USE_ION: + plt.ion() + plt.show() print("") diff --git a/gamestonk_terminal/technical_analysis/volatility.py b/gamestonk_terminal/technical_analysis/volatility.py index b15e8d74c90..b394ba4c2c2 100644 --- a/gamestonk_terminal/technical_analysis/volatility.py +++ b/gamestonk_terminal/technical_analysis/volatility.py @@ -3,6 +3,7 @@ import matplotlib.pyplot as plt import pandas_ta as ta from pandas.plotting import register_matplotlib_converters from gamestonk_terminal.helper_funcs import check_positive, parse_known_args_and_warn +from gamestonk_terminal import feature_flags as gtff register_matplotlib_converters() @@ -106,7 +107,10 @@ def bbands(l_args, s_ticker, s_interval, df_stock): plt.grid(b=True, which="major", color="#666666", linestyle="-") plt.minorticks_on() plt.grid(b=True, which="minor", color="#999999", linestyle="-", alpha=0.2) - plt.ion() + + if gtff.USE_ION: + plt.ion() + plt.show() print("") diff --git a/gamestonk_terminal/technical_analysis/volume.py b/gamestonk_terminal/technical_analysis/volume.py index 9a21781c45d..871715e463d 100644 --- a/gamestonk_terminal/technical_analysis/volume.py +++ b/gamestonk_terminal/technical_analysis/volume.py @@ -3,6 +3,7 @@ import matplotlib.pyplot as plt import pandas_ta as ta from pandas.plotting import register_matplotlib_converters from gamestonk_terminal.helper_funcs import check_positive, parse_known_args_and_warn +from gamestonk_terminal import feature_flags as gtff register_matplotlib_converters() @@ -129,7 +130,10 @@ def ad(l_args, s_ticker, s_interval, df_stock): plt.grid(b=True, which="major", color="#666666", linestyle="-") plt.minorticks_on() plt.grid(b=True, which="minor", color="#999999", linestyle="-", alpha=0.2) - plt.ion() + + if gtff.USE_ION: + plt.ion() + plt.show() print("") @@ -222,7 +226,10 @@ def obv(l_args, s_ticker, s_interval, df_stock): plt.grid(b=True, which="major", color="#666666", linestyle="-") plt.minorticks_on() plt.grid(b=True, which="minor", color="#999999", linestyle="-", alpha=0.2) - plt.ion() + + if gtff.USE_ION: + plt.ion() + plt.show() print("") diff --git a/terminal.py b/terminal.py index 61b923dbd85..0292aae4dd1 100644 --- a/terminal.py +++ b/terminal.py @@ -7,6 +7,7 @@ from alpha_vantage.timeseries import TimeSeries from prompt_toolkit.completion import NestedCompleter from gamestonk_terminal import config_terminal as cfg +from gamestonk_terminal import feature_flags as gtff from gamestonk_terminal import res_menu as rm from gamestonk_terminal.discovery import disc_menu as dm from gamestonk_terminal.due_diligence import dd_menu as ddm @@ -77,7 +78,7 @@ def main(): should_print_help = False # Get input command from user - if session: + if session and gtff.USE_PROMPT_TOOLKIT: as_input = session.prompt(f"{get_flair()}> ", completer=completer) else: as_input = input(f"{get_flair()}> ") @@ -148,7 +149,7 @@ def main(): elif ns_known_args.opt == "pred": - if not cfg.ENABLE_PREDICT: + if not gtff.ENABLE_PREDICT: print("Predict is not enabled in config_terminal.py") print("Prediction menu is disabled") print("") diff --git a/tests/test_pred_neural_networks.py b/tests/test_pred_neural_networks.py index 0eeb5a42fd5..cc369861296 100644 --- a/tests/test_pred_neural_networks.py +++ b/tests/test_pred_neural_networks.py @@ -8,12 +8,12 @@ except ModuleNotFoundError as e: print(e) print("Skipping the test") -from gamestonk_terminal import config_terminal as cfg +from gamestonk_terminal import feature_flags as gtff class TestPredNeuralNetworks(unittest.TestCase): def test_mlp(self): - if not cfg.ENABLE_PREDICT: + if not gtff.ENABLE_PREDICT: return # Fix: need to come up with a better way of doing this diff --git a/tests/test_sentiment_twitter_api.py b/tests/test_sentiment_twitter_api.py index e0eda62da3d..fa536db0754 100644 --- a/tests/test_sentiment_twitter_api.py +++ b/tests/test_sentiment_twitter_api.py @@ -10,19 +10,19 @@ except ModuleNotFoundError as e: print(e) print("Skipping the test") -from gamestonk_terminal import config_terminal as cfg +from gamestonk_terminal import feature_flags as gtff class TestSentimentTwitterApi(unittest.TestCase): def test_inference(self): - if not cfg.ENABLE_PREDICT: + if not gtff.ENABLE_PREDICT: return # Fix: implement a better twitter client # inference([], "PLTR") return def test_sentiment(self): - if not cfg.ENABLE_PREDICT: + if not gtff.ENABLE_PREDICT: return # Fix: implement a better twitter client # sentiment([], "PLTR")