From 610b19bbb5b97647f2a7148436c7603c8ea00e35 Mon Sep 17 00:00:00 2001 From: Sam Kerr Date: Mon, 6 Jun 2022 15:29:40 -0400 Subject: [PATCH] Clarify values by re-ordering rows in enterprise value report (#1908) * Re-order columns in enterprise value report * Update test files with changed values Co-authored-by: James Maslek --- .../financial_modeling_prep/fmp_view.py | 13 +++++++++++++ ...utput[False-display_enterprise-kwargs_dict2].txt | 2 +- ...output[True-display_enterprise-kwargs_dict2].txt | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/openbb_terminal/stocks/fundamental_analysis/financial_modeling_prep/fmp_view.py b/openbb_terminal/stocks/fundamental_analysis/financial_modeling_prep/fmp_view.py index 6fd1a545582..c289beb9cb9 100644 --- a/openbb_terminal/stocks/fundamental_analysis/financial_modeling_prep/fmp_view.py +++ b/openbb_terminal/stocks/fundamental_analysis/financial_modeling_prep/fmp_view.py @@ -104,6 +104,19 @@ def display_enterprise( """ df_fa = fmp_model.get_enterprise(ticker, number, quarterly) df_fa = df_fa[df_fa.columns[::-1]] + + # Re-order the returned columns so they are in a more logical ordering + df_fa = df_fa.reindex( + [ + "Symbol", + "Stock price", + "Number of shares", + "Market capitalization", + "Add total debt", + "Minus cash and cash equivalents", + "Enterprise value", + ] + ) if df_fa.empty: console.print("[red]No data available[/red]\n") else: diff --git a/tests/openbb_terminal/stocks/fundamental_analysis/financial_modeling_prep/txt/test_fmp_view/test_check_output[False-display_enterprise-kwargs_dict2].txt b/tests/openbb_terminal/stocks/fundamental_analysis/financial_modeling_prep/txt/test_fmp_view/test_check_output[False-display_enterprise-kwargs_dict2].txt index 6be95b7bf4d..aa08e6e1b71 100644 --- a/tests/openbb_terminal/stocks/fundamental_analysis/financial_modeling_prep/txt/test_fmp_view/test_check_output[False-display_enterprise-kwargs_dict2].txt +++ b/tests/openbb_terminal/stocks/fundamental_analysis/financial_modeling_prep/txt/test_fmp_view/test_check_output[False-display_enterprise-kwargs_dict2].txt @@ -3,6 +3,6 @@ Symbol PM PM PM PM Stock price 107.940 74.480 84.330 79.650 103.520 Number of shares 1.552 B 1.555 B 1.555 B 1.557 B 1.557 B Market capitalization 167.523 B 115.816 B 131.133 B 124.015 B 161.181 B -Minus cash and cash equivalents 8.447 B 6.593 B 6.861 B 7.280 B 4.496 B Add total debt 34.339 B 31.759 B 31.045 B 31.536 B 27.806 B +Minus cash and cash equivalents 8.447 B 6.593 B 6.861 B 7.280 B 4.496 B Enterprise value 193.415 B 140.982 B 155.317 B 148.271 B 184.491 B diff --git a/tests/openbb_terminal/stocks/fundamental_analysis/financial_modeling_prep/txt/test_fmp_view/test_check_output[True-display_enterprise-kwargs_dict2].txt b/tests/openbb_terminal/stocks/fundamental_analysis/financial_modeling_prep/txt/test_fmp_view/test_check_output[True-display_enterprise-kwargs_dict2].txt index 6be95b7bf4d..aa08e6e1b71 100644 --- a/tests/openbb_terminal/stocks/fundamental_analysis/financial_modeling_prep/txt/test_fmp_view/test_check_output[True-display_enterprise-kwargs_dict2].txt +++ b/tests/openbb_terminal/stocks/fundamental_analysis/financial_modeling_prep/txt/test_fmp_view/test_check_output[True-display_enterprise-kwargs_dict2].txt @@ -3,6 +3,6 @@ Symbol PM PM PM PM Stock price 107.940 74.480 84.330 79.650 103.520 Number of shares 1.552 B 1.555 B 1.555 B 1.557 B 1.557 B Market capitalization 167.523 B 115.816 B 131.133 B 124.015 B 161.181 B -Minus cash and cash equivalents 8.447 B 6.593 B 6.861 B 7.280 B 4.496 B Add total debt 34.339 B 31.759 B 31.045 B 31.536 B 27.806 B +Minus cash and cash equivalents 8.447 B 6.593 B 6.861 B 7.280 B 4.496 B Enterprise value 193.415 B 140.982 B 155.317 B 148.271 B 184.491 B