From 1f5d29179939837cb744eb40a24a097a1cb1f359 Mon Sep 17 00:00:00 2001 From: James Maslek Date: Mon, 24 Apr 2023 16:42:13 -0400 Subject: [PATCH 1/3] Remove tab, fix overwrite, transpose exports --- openbb_terminal/featflags_controller.py | 10 +--------- openbb_terminal/miscellaneous/i18n/en.yml | 1 - openbb_terminal/stocks/fundamental_analysis/av_view.py | 6 +++--- .../stocks/fundamental_analysis/fmp_view.py | 10 +++++----- .../stocks/fundamental_analysis/polygon_view.py | 2 +- .../stocks/fundamental_analysis/yahoo_finance_view.py | 2 +- tests/openbb_terminal/test_featflags_controller.py | 4 ---- 7 files changed, 11 insertions(+), 24 deletions(-) diff --git a/openbb_terminal/featflags_controller.py b/openbb_terminal/featflags_controller.py index 0f0100529a81..43ef32893e60 100644 --- a/openbb_terminal/featflags_controller.py +++ b/openbb_terminal/featflags_controller.py @@ -77,7 +77,6 @@ def print_help(self): mt.add_info("_info_") mt.add_raw("\n") mt.add_setting("retryload", current_user.preferences.RETRY_WITH_LOAD) - mt.add_setting("tab", current_user.preferences.USE_TABULATE_DF) mt.add_setting("interactive", current_user.preferences.USE_INTERACTIVE_DF) mt.add_setting("cls", current_user.preferences.USE_CLEAR_AFTER_CMD) mt.add_setting("promptkit", current_user.preferences.USE_PROMPT_TOOLKIT) @@ -95,7 +94,7 @@ def print_help(self): def call_overwrite(self, _): """Process overwrite command""" set_and_save_preference( - "FILE_OVERWITE", not get_current_user().preferences.FILE_OVERWRITE + "FILE_OVERWRITE", not get_current_user().preferences.FILE_OVERWRITE ) def call_version(self, _): @@ -110,13 +109,6 @@ def call_retryload(self, _): "RETRY_WITH_LOAD", not get_current_user().preferences.RETRY_WITH_LOAD ) - @log_start_end(log=logger) - def call_tab(self, _): - """Process tab command""" - set_and_save_preference( - "USE_TABULATE_DF", not get_current_user().preferences.USE_TABULATE_DF - ) - @log_start_end(log=logger) def call_interactive(self, _): """Process interactive command""" diff --git a/openbb_terminal/miscellaneous/i18n/en.yml b/openbb_terminal/miscellaneous/i18n/en.yml index df319972174b..eb46cce409be 100644 --- a/openbb_terminal/miscellaneous/i18n/en.yml +++ b/openbb_terminal/miscellaneous/i18n/en.yml @@ -48,7 +48,6 @@ en: sources/set: set default data source for a command featflags/_info_: Feature flags through environment variables featflags/retryload: retry misspelled commands with load first - featflags/tab: use tabulate to print dataframes featflags/interactive: open dataframes in interactive window featflags/cls: clear console after each command featflags/color: use coloring features diff --git a/openbb_terminal/stocks/fundamental_analysis/av_view.py b/openbb_terminal/stocks/fundamental_analysis/av_view.py index 3de31755121d..d21af737cbf8 100644 --- a/openbb_terminal/stocks/fundamental_analysis/av_view.py +++ b/openbb_terminal/stocks/fundamental_analysis/av_view.py @@ -174,7 +174,7 @@ def display_income_statement( export, os.path.dirname(os.path.abspath(__file__)), "income", - df_income, + df_income.transpose(), sheet_name, fig, ) @@ -271,7 +271,7 @@ def display_balance_sheet( export, os.path.dirname(os.path.abspath(__file__)), "balance", - df_balance, + df_balance.transpose(), sheet_name, fig, ) @@ -366,7 +366,7 @@ def display_cash_flow( export, os.path.dirname(os.path.abspath(__file__)), "cash", - df_cash, + df_cash.transpose(), sheet_name, fig, ) diff --git a/openbb_terminal/stocks/fundamental_analysis/fmp_view.py b/openbb_terminal/stocks/fundamental_analysis/fmp_view.py index 88a8b2d5f043..3fd611b35001 100644 --- a/openbb_terminal/stocks/fundamental_analysis/fmp_view.py +++ b/openbb_terminal/stocks/fundamental_analysis/fmp_view.py @@ -345,7 +345,7 @@ def display_income_statement( export, os.path.dirname(os.path.abspath(__file__)), "income", - income, + income.transpose(), sheet_name, fig, ) @@ -449,7 +449,7 @@ def display_balance_sheet( export, os.path.dirname(os.path.abspath(__file__)), "balance", - balance, + balance.transpose(), sheet_name, fig, ) @@ -553,7 +553,7 @@ def display_cash_flow( export, os.path.dirname(os.path.abspath(__file__)), "cash", - cash, + cash.transpose(), sheet_name, fig, ) @@ -650,7 +650,7 @@ def display_financial_ratios( export, os.path.dirname(os.path.abspath(__file__)), "grratiosowth", - ratios, + ratios.transpose(), sheet_name, ) else: @@ -697,7 +697,7 @@ def display_financial_statement_growth( export, os.path.dirname(os.path.abspath(__file__)), "growth", - growth, + growth.transpose(), sheet_name, ) else: diff --git a/openbb_terminal/stocks/fundamental_analysis/polygon_view.py b/openbb_terminal/stocks/fundamental_analysis/polygon_view.py index a0c647f6e4e3..ce9c27709db2 100644 --- a/openbb_terminal/stocks/fundamental_analysis/polygon_view.py +++ b/openbb_terminal/stocks/fundamental_analysis/polygon_view.py @@ -131,7 +131,7 @@ def display_fundamentals( export, os.path.dirname(os.path.abspath(__file__)), statement, - fundamentals, + fundamentals.transpose(), sheet_name, fig, ) diff --git a/openbb_terminal/stocks/fundamental_analysis/yahoo_finance_view.py b/openbb_terminal/stocks/fundamental_analysis/yahoo_finance_view.py index 7eed78530205..32e3dc781364 100644 --- a/openbb_terminal/stocks/fundamental_analysis/yahoo_finance_view.py +++ b/openbb_terminal/stocks/fundamental_analysis/yahoo_finance_view.py @@ -459,7 +459,7 @@ def display_fundamentals( export, os.path.dirname(os.path.abspath(__file__)), statement, - fundamentals, + fundamentals.transpose(), sheet_name, fig, ) diff --git a/tests/openbb_terminal/test_featflags_controller.py b/tests/openbb_terminal/test_featflags_controller.py index 1ed75da1a9c9..635fbada0afe 100644 --- a/tests/openbb_terminal/test_featflags_controller.py +++ b/tests/openbb_terminal/test_featflags_controller.py @@ -34,10 +34,6 @@ def test_print_help(controller): controller.print_help() -def test_call_tab(controller): - controller.call_tab(None) - - def test_call_cls(controller): controller.call_cls(None) From 9281b2cb1ce42d4c8f7c38b86d3c66325424812d Mon Sep 17 00:00:00 2001 From: James Maslek Date: Mon, 24 Apr 2023 16:48:33 -0400 Subject: [PATCH 2/3] missed some --- openbb_terminal/stocks/fundamental_analysis/av_view.py | 2 +- openbb_terminal/stocks/fundamental_analysis/fmp_view.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openbb_terminal/stocks/fundamental_analysis/av_view.py b/openbb_terminal/stocks/fundamental_analysis/av_view.py index d21af737cbf8..922d0f71f00e 100644 --- a/openbb_terminal/stocks/fundamental_analysis/av_view.py +++ b/openbb_terminal/stocks/fundamental_analysis/av_view.py @@ -77,7 +77,7 @@ def display_key(symbol: str, export: str = "", sheet_name: Optional[str] = None) export, os.path.dirname(os.path.abspath(__file__)), "key", - df_key, + df_key.transpose(), sheet_name, ) diff --git a/openbb_terminal/stocks/fundamental_analysis/fmp_view.py b/openbb_terminal/stocks/fundamental_analysis/fmp_view.py index 3fd611b35001..057f7104e9af 100644 --- a/openbb_terminal/stocks/fundamental_analysis/fmp_view.py +++ b/openbb_terminal/stocks/fundamental_analysis/fmp_view.py @@ -241,7 +241,7 @@ def display_discounted_cash_flow( export, os.path.dirname(os.path.abspath(__file__)), "dcf", - dcf, + dcf.transpose(), sheet_name, ) @@ -602,7 +602,7 @@ def display_key_metrics( export, os.path.dirname(os.path.abspath(__file__)), "metrics", - key_metrics, + key_metrics.transpose(), sheet_name, ) else: From 1e0975ce622e1aaa9ce2b378d60502248e8b0619 Mon Sep 17 00:00:00 2001 From: James Maslek Date: Mon, 24 Apr 2023 16:49:58 -0400 Subject: [PATCH 3/3] eodhd transpose --- openbb_terminal/stocks/fundamental_analysis/eodhd_view.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openbb_terminal/stocks/fundamental_analysis/eodhd_view.py b/openbb_terminal/stocks/fundamental_analysis/eodhd_view.py index ca6583e4bb35..7bef2ae96fbb 100644 --- a/openbb_terminal/stocks/fundamental_analysis/eodhd_view.py +++ b/openbb_terminal/stocks/fundamental_analysis/eodhd_view.py @@ -141,7 +141,7 @@ def display_fundamentals( export, os.path.dirname(os.path.abspath(__file__)), statement, - fundamentals, + fundamentals.transpose(), sheet_name, fig, )