Skip to content

Commit

Permalink
Deprecate reddit commands taking too long to connect to PushshiftAPI (#…
Browse files Browse the repository at this point in the history
…3999)

* fix tk

* fix newsletters

* fix lt

* exception on pir

* fix attrib bug and remove warning

* fix earnings

* fix ins, lt, whatif

* fillna

* fix vis

* timeout reddit func

* fix interest

* black

* pylint

* pylint again

* back to timeout

* rewind

* deprecate pushshift api commands

* rewrite expected

Co-authored-by: James Maslek <[email protected]>
  • Loading branch information
montezdesousa and jmaslek authored Jan 24, 2023
1 parent 3f9c961 commit 43dd410
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 20 deletions.
2 changes: 2 additions & 0 deletions openbb_terminal/common/behavioural_analysis/google_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ def display_correlation_interest(
colors = theme.get_colors()[1:]
for idx, word in enumerate(words):
df_interest = google_model.get_mentions(word)
if df_interest.empty:
continue
ax[1].plot(df_interest.index, df_interest[word], "-", color=colors[idx])

ax[1].set_ylabel("Interest [%]")
Expand Down
5 changes: 0 additions & 5 deletions openbb_terminal/miscellaneous/library/trail_map.csv
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,9 @@ stocks.ba.mentions,openbb_terminal.common.behavioural_analysis.google_model.get_
stocks.ba.queries,openbb_terminal.common.behavioural_analysis.google_model.get_queries,
stocks.ba.regions,openbb_terminal.common.behavioural_analysis.google_model.get_regions,openbb_terminal.common.behavioural_analysis.google_view.display_regions
stocks.ba.rise,openbb_terminal.common.behavioural_analysis.google_model.get_rise,
stocks.ba.getdd,openbb_terminal.common.behavioural_analysis.reddit_model.get_due_dilligence,
stocks.ba.popular,openbb_terminal.common.behavioural_analysis.reddit_model.get_popular_tickers,
stocks.ba.redditsent,openbb_terminal.common.behavioural_analysis.reddit_model.get_posts_about,
stocks.ba.text_sent,openbb_terminal.common.behavioural_analysis.reddit_model.get_sentiment,
stocks.ba.spac,openbb_terminal.common.behavioural_analysis.reddit_model.get_spac,
stocks.ba.spacc,openbb_terminal.common.behavioural_analysis.reddit_model.get_spac_community,
stocks.ba.watchlist,openbb_terminal.common.behavioural_analysis.reddit_model.get_watchlists,
stocks.ba.wsb,openbb_terminal.common.behavioural_analysis.reddit_model.get_wsb_community,
stocks.ba.hist,openbb_terminal.common.behavioural_analysis.sentimentinvestor_model.get_historical,openbb_terminal.common.behavioural_analysis.sentimentinvestor_view.display_historical
stocks.ba.trend,openbb_terminal.common.behavioural_analysis.sentimentinvestor_model.get_trending,openbb_terminal.common.behavioural_analysis.sentimentinvestor_view.display_trending
Expand Down Expand Up @@ -549,4 +545,3 @@ futures.historical,openbb_terminal.futures.yfinance_model.get_historical_futures
futures.curve,openbb_terminal.futures.yfinance_model.get_curve_futures,openbb_terminal.futures.yfinance_view.display_curve
economy.get_groups,openbb_terminal.economy.finviz_model.get_groups,
stocks.filings,openbb_terminal.stocks.fundamental_analysis.fmp_model.get_filings,openbb_terminal.stocks.fundamental_analysis.fmp_view.display_filings

8 changes: 5 additions & 3 deletions openbb_terminal/portfolio/portfolio_engine.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Portfolio Engine"""
__docformat__ = "numpy"

from os import environ
import warnings
import logging
from typing import Dict, Any
Expand Down Expand Up @@ -193,9 +194,10 @@ def read_transactions(path: str) -> pd.DataFrame:

# Load transactions from file
if path.endswith(".xlsx"):
warnings.filterwarnings(
"ignore", category=UserWarning, module="openpyxl", lineno=312
)
if environ.get("DEBUG_MODE", "false") != "true":
warnings.filterwarnings(
"ignore", category=UserWarning, module="openpyxl"
)
transactions = pd.read_excel(path)
elif path.endswith(".csv"):
transactions = pd.read_csv(path)
Expand Down
16 changes: 8 additions & 8 deletions openbb_terminal/stocks/behavioural_analysis/ba_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class BehaviouralAnalysisController(StockBaseController):

CHOICES_COMMANDS = [
"load",
"watchlist",
"spac",
# "watchlist",
# "spac",
"spacc",
"wsb",
"popular",
Expand All @@ -59,8 +59,8 @@ class BehaviouralAnalysisController(StockBaseController):
"queries",
"rise",
"headlines",
"popular",
"getdd",
# "popular",
# "getdd",
"snews",
"interest",
]
Expand Down Expand Up @@ -95,11 +95,11 @@ def print_help(self):
mt.add_cmd("headlines", self.ticker)
mt.add_cmd("snews", self.ticker)
mt.add_cmd("wsb")
mt.add_cmd("watchlist")
mt.add_cmd("popular")
# mt.add_cmd("watchlist")
# mt.add_cmd("popular")
mt.add_cmd("spacc")
mt.add_cmd("spac")
mt.add_cmd("getdd", self.ticker)
# mt.add_cmd("spac")
# mt.add_cmd("getdd", self.ticker)
mt.add_cmd("redditsent", self.ticker)
mt.add_cmd("trending")
mt.add_cmd("stalker")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ Ticker: TSLA
headlines sentiment from 15+ major news headlines [FinBrain]
snews stock price displayed over sentiment of news headlines [Finnhub]
wsb show what WSB gang is up to in subreddit wallstreetbets [Reddit]
watchlist show other users watchlist [Reddit]
popular show popular tickers [Reddit]
spacc show other users spacs announcements from subreddit SPACs [Reddit]
spac show other users spacs announcements from other subs [Reddit]
getdd gets due diligence from another user's post [Reddit]
redditsent searches reddit for ticker and finds reddit sentiment [Reddit]
trending trending stocks [Stocktwits]
stalker stalk stocktwits user's last messages [Stocktwits]
Expand Down

0 comments on commit 43dd410

Please sign in to comment.