From 58a36d24b7bc0a9022761cb0f00a1ea22efb0a73 Mon Sep 17 00:00:00 2001 From: James Simmons <53658028+simmonsj330@users.noreply.github.com> Date: Thu, 3 Nov 2022 16:09:42 -0400 Subject: [PATCH] plots and stuff (#3231) Co-authored-by: James Maslek --- .../cryptocurrency/onchain/onchain_controller.py | 10 +++++++--- .../cryptocurrency/overview/overview_controller.py | 6 ++++-- .../cryptocurrency/overview/pycoingecko_view.py | 11 ++++++++--- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/openbb_terminal/cryptocurrency/onchain/onchain_controller.py b/openbb_terminal/cryptocurrency/onchain/onchain_controller.py index 960575aa045..264daf8db99 100644 --- a/openbb_terminal/cryptocurrency/onchain/onchain_controller.py +++ b/openbb_terminal/cryptocurrency/onchain/onchain_controller.py @@ -135,7 +135,8 @@ class OnchainController(BaseController): "--since": None, "-s": "--since", } - choices["ttcp"] = {c: {} for c in bitquery_model.DECENTRALIZED_EXCHANGES} + choices["baas"]["-c"] = {c: {} for c in bitquery_model.POSSIBLE_CRYPTOS} + choices["baas"]["--coin"] = {c: {} for c in bitquery_model.POSSIBLE_CRYPTOS} choices["balance"] = { "--sort": {c: None for c in ethplorer_model.BALANCE_FILTERS}, "-s": "--sort", @@ -224,7 +225,10 @@ class OnchainController(BaseController): "-s": "--sort", "--descend": {}, } - choices["ttcp"] = {c: {} for c in bitquery_model.DECENTRALIZED_EXCHANGES} + choices["ttcp"]["--exchanges"] = { + c: {} for c in bitquery_model.DECENTRALIZED_EXCHANGES + } + choices["ttcp"]["-e"] = "--exchanges" choices["ttcp"]["--sort"] = {c: None for c in bitquery_model.TTCP_FILTERS} choices["ttcp"]["-s"] = "--sort" choices["ttcp"]["--days"] = {str(c): {} for c in range(1, 100)} @@ -1472,7 +1476,7 @@ class OnchainController(BaseController): parser.add_argument( "--descend", - action="store_false", + action="store_true", help="Flag to sort in descending order (lowest first)", dest="descend", default=False, diff --git a/openbb_terminal/cryptocurrency/overview/overview_controller.py b/openbb_terminal/cryptocurrency/overview/overview_controller.py index 9912fbf6785..6f871036a42 100644 --- a/openbb_terminal/cryptocurrency/overview/overview_controller.py +++ b/openbb_terminal/cryptocurrency/overview/overview_controller.py @@ -200,9 +200,10 @@ class OverviewController(BaseController): "--urls": {}, "-u": "--urls", } - choices["contracts"] = { + choices["contracts"]["--platform"] = { c: None for c in get_all_contract_platforms()["platform_id"].tolist() } + choices["contracts"]["-p"] = "--platform" choices["contracts"]["--sortby"] = { c: None for c in coinpaprika_model.CONTRACTS_FILTERS } @@ -210,7 +211,8 @@ class OverviewController(BaseController): choices["contracts"]["--limit"] = {str(c): {} for c in range(1, 100)} choices["contracts"]["-l"] = "--limit" choices["contracts"]["--descend"] = {} - choices["hm"] = {c: {} for c in get_categories_keys()} + choices["hm"]["--category"] = {c: {} for c in get_categories_keys()} + choices["hm"]["-c"] = "--category" choices["hm"]["--limit"] = {str(c): {} for c in range(1, 100)} choices["hm"]["-l"] = "--limit" choices["info"] = { diff --git a/openbb_terminal/cryptocurrency/overview/pycoingecko_view.py b/openbb_terminal/cryptocurrency/overview/pycoingecko_view.py index cc7d972e1a6..4f1168a558c 100644 --- a/openbb_terminal/cryptocurrency/overview/pycoingecko_view.py +++ b/openbb_terminal/cryptocurrency/overview/pycoingecko_view.py @@ -158,8 +158,10 @@ def display_holdings_overview( for _, row in df.iterrows(): ax.bar(x=row["Symbol"], height=row["Total Holdings"]) - - ax.set_ylabel("BTC Number") + if symbol == "bitcoin": + ax.set_ylabel("BTC Number") + else: + ax.set_ylabel("ETH Number") ax.get_yaxis().set_major_formatter( ticker.FuncFormatter( lambda x, _: lambda_long_number_format_with_type_check(x) @@ -167,7 +169,10 @@ def display_holdings_overview( ) ax.set_xlabel("Company Symbol") fig.tight_layout(pad=8) - ax.set_title("Total BTC Holdings per company") + if symbol == "bitcoin": + ax.set_title("Total BTC Holdings per company") + else: + ax.set_title("Total ETH Holdings per company") ax.tick_params(axis="x", labelrotation=90) console.print(f"\n{stats_string}\n") df = df.applymap(lambda x: lambda_long_number_format_with_type_check(x))