Squishy the bugs (#1391)

* options screener tickers to list(set(

* Fix fred rmv bug

* Fix prt

* Fix tests + change where list is called
This commit is contained in:
jmaslek
2022-02-19 07:31:37 -05:00
committed by GitHub
parent fd58219282
commit 4697efcf26
4 changed files with 22 additions and 19 deletions

View File

@@ -125,11 +125,14 @@ class CryptoController(CryptoBaseController):
"Tool to check returns if loaded coin reaches provided price or other crypto market cap"
"Uses CoinGecko to grab coin data (price and market cap).",
)
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument(
"--vs", help="Coin to compare with", dest="vs", type=str, default=None
parser.add_argument(
"--vs",
help="Coin to compare with",
dest="vs",
type=str,
required="-h" not in other_args,
)
group.add_argument(
parser.add_argument(
"-p",
"--price",
help="Desired price",
@@ -137,7 +140,7 @@ class CryptoController(CryptoBaseController):
type=int,
default=None,
)
group.add_argument(
parser.add_argument(
"-t",
"--top",
help="Compare with top N coins",
@@ -160,17 +163,17 @@ class CryptoController(CryptoBaseController):
f"VS Coin '{ns_parser.vs}' not found in CoinGecko\n"
)
return
pycoingecko_view.display_coin_potential_returns(
self.coin_map_df["CoinGecko"],
coin_found,
ns_parser.top,
ns_parser.price,
)
pycoingecko_view.display_coin_potential_returns(
self.coin_map_df["CoinGecko"],
coin_found,
ns_parser.top,
ns_parser.price,
)
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"
)
@log_start_end(log=logger)
def call_chart(self, other_args):

View File

@@ -161,7 +161,7 @@ class FredController(BaseController):
"-i",
"--id",
type=lambda x: x.lower(),
choices=self.current_series.keys(),
choices=[key.lower() for key in self.current_series],
required="-h" not in other_args
and "-a" not in other_args
and "--all" not in other_args,
@@ -187,7 +187,7 @@ class FredController(BaseController):
else:
self.current_series.pop(ns_parser.series_id)
console.print(
f"Current Series Ids: [blue]{', '.join(self.current_series.keys()) or None}[/blue]\n"
f"Current Series Ids: [blue]{', '.join(self.current_series.keys()) .upper() or None}[/blue]\n"
)
@log_start_end(log=logger)

View File

@@ -97,7 +97,7 @@ def view_screener_output(
)
console.print("")
return df_res["S"].values.tolist()
return list(set(df_res["S"].values.tolist()))
# pylint:disable=too-many-arguments

View File

@@ -280,7 +280,7 @@ def test_call_func(
mock.assert_called_once()
else:
controller = fred_controller.FredController(queue=None)
controller.current_series = {"MOCK_DICT_KEY_1": "MOCK_DICT_VALUE_1"}
controller.current_series = {"mock_dict_key1": "MOCK_DICT_VALUE_1"}
getattr(controller, tested_func)(other_args)