fix wsb/deprecate spacc

This commit is contained in:
James Maslek
2023-08-08 14:41:40 -04:00
parent ed78b5e494
commit e122a0bb55
4 changed files with 4 additions and 51 deletions

View File

@@ -1,6 +1,7 @@
"""Reddit View."""
__docformat__ = "numpy"
import io
import logging
import os
import textwrap
@@ -212,10 +213,10 @@ def display_wsb_community(limit: int = 10, new: bool = False):
Flag to sort by new instead of hot, by default False
"""
subs = reddit_model.get_wsb_community(limit, new)
# I am not proud of this, but it works to eliminate the max recursion bug
subs = pd.read_csv(io.StringIO(subs.to_csv()), index_col=0).fillna("-")
if not subs.empty:
# for sub in subs.iterrows():
# print_reddit_post(sub)
print(print_rich_table(subs))
print_rich_table(subs)
@log_start_end(log=logger)

View File

@@ -47,7 +47,6 @@ class BehaviouralAnalysisController(StockBaseController):
"load",
"wsb",
"popular",
"spacc",
"getdd",
"redditsent",
"bullbear",
@@ -97,7 +96,6 @@ class BehaviouralAnalysisController(StockBaseController):
mt.add_cmd("snews", self.ticker)
mt.add_cmd("wsb")
mt.add_cmd("popular")
mt.add_cmd("spacc")
mt.add_cmd("getdd")
mt.add_cmd("redditsent", self.ticker)
mt.add_cmd("trending")
@@ -137,40 +135,6 @@ class BehaviouralAnalysisController(StockBaseController):
symbol=self.ticker, export=ns_parser.export
)
@log_start_end(log=logger)
def call_spacc(self, other_args: List[str]):
"""Process spacc command."""
parser = argparse.ArgumentParser(
add_help=False,
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
prog="spacc",
description="""Print other users SPACs announcement under subreddit 'SPACs'. [Source: Reddit]""",
)
parser.add_argument(
"-l",
"--limit",
action="store",
dest="n_limit",
type=check_positive,
default=10,
help="limit of posts with SPACs retrieved",
)
parser.add_argument(
"-p",
"--popular",
action="store_true",
default=False,
dest="b_popular",
help="popular flag, if true the posts retrieved are based on score rather than time",
)
if other_args and "-" not in other_args[0][0]:
other_args.insert(0, "-l")
ns_parser = self.parse_known_args_and_warn(parser, other_args)
if ns_parser:
reddit_view.display_spac_community(
limit=ns_parser.n_limit, popular=ns_parser.b_popular
)
@log_start_end(log=logger)
def call_wsb(self, other_args: List[str]):
"""Process wsb command."""

View File

@@ -238,16 +238,6 @@ def test_call_func_expect_queue(expected_queue, queue, func):
@pytest.mark.parametrize(
"tested_func, other_args, mocked_func, called_args, called_kwargs",
[
(
"call_spacc",
["--limit=5", "--popular"],
"reddit_view.display_spac_community",
[],
dict(
limit=5,
popular=True,
),
),
(
"call_wsb",
["--limit=5", "--new"],
@@ -426,7 +416,6 @@ def test_call_func(
@pytest.mark.parametrize(
"func",
[
"call_spacc",
"call_wsb",
"call_popular",
"call_bullbear",

View File

@@ -6,7 +6,6 @@ Ticker: TSLA
snews stock price displayed over sentiment of news headlines [Finnhub]
wsb show what WSB gang is up to in subreddit wallstreetbets [Reddit]
popular show popular tickers [Reddit]
spacc show other users spacs announcements from subreddit SPACs [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]