mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 20:42:26 +00:00
Bug fixes (#3423)
* Got basic testing file done * Continued progress on new integrated tests * Allow for dynamic parameters, update docs * Massive improvements * Improved CSV file * Renamed file per James2 * Added fixes * Added fixes * Combined the docs * Renamed file * Fixed typing issue and simplified code * Captures output for tests * Fixes 3418 * Fixed financial statement exports * Fixed sean seah * Handle no ticker * Added fixes * Removed unwanted changes * Removed unwanted changes * Removed unwanted changes * Fixed tests * Fixed tests
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -30,8 +30,10 @@ openbb_terminal/portfolio/portfolios/*
|
||||
.coverage.*
|
||||
!openbb_terminal/reports/templates/*.ipynb
|
||||
*_tests.csv
|
||||
*_sdk_audit.csv
|
||||
integration_test_output/*
|
||||
openbb_terminal/reports/templates/*.html
|
||||
website/functions
|
||||
*_sdk_audit.csv
|
||||
website/terminaltest
|
||||
|
||||
# pyinstaller artifacts
|
||||
|
||||
4
openbb_terminal/miscellaneous/i18n/en.yml
vendored
4
openbb_terminal/miscellaneous/i18n/en.yml
vendored
@@ -279,9 +279,7 @@ en:
|
||||
stocks/ca/ticker: set ticker to get similar companies from
|
||||
stocks/ca/_ticker: Ticker to get similar companies from
|
||||
stocks/ca/tsne: run TSNE on all SP500 stocks and returns closest tickers
|
||||
stocks/ca/getpoly: get similar stocks
|
||||
stocks/ca/getfinnhub: get similar stocks
|
||||
stocks/ca/getfinviz: get similar stocks
|
||||
stocks/ca/get: get similar stocks
|
||||
stocks/ca/set: reset and set similar companies
|
||||
stocks/ca/add: add more similar companies
|
||||
stocks/ca/rmv: remove similar companies individually or all
|
||||
|
||||
@@ -103,8 +103,17 @@ def get_headlines_sentiment(
|
||||
----------
|
||||
symbol : str
|
||||
Ticker of company
|
||||
|
||||
Returns
|
||||
----------
|
||||
pd.DataFrame
|
||||
The news article information
|
||||
"""
|
||||
start = datetime.now() - timedelta(days=30)
|
||||
if not symbol:
|
||||
console.print("[red]Do not run this command without setting a ticker.[/red]\n")
|
||||
return pd.DataFrame()
|
||||
|
||||
articles = get_company_news(
|
||||
symbol.upper(),
|
||||
start_date=start.strftime("%Y-%m-%d"),
|
||||
|
||||
@@ -582,6 +582,7 @@ class ComparisonAnalysisController(BaseController):
|
||||
symbols=self.similar,
|
||||
timeframe=ns_parser.s_timeframe,
|
||||
quarter=ns_parser.b_quarter,
|
||||
export=ns_parser.export,
|
||||
)
|
||||
|
||||
@log_start_end(log=logger)
|
||||
@@ -654,6 +655,7 @@ class ComparisonAnalysisController(BaseController):
|
||||
symbols=self.similar,
|
||||
timeframe=ns_parser.s_timeframe,
|
||||
quarter=ns_parser.b_quarter,
|
||||
export=ns_parser.export,
|
||||
)
|
||||
|
||||
@log_start_end(log=logger)
|
||||
@@ -693,6 +695,7 @@ class ComparisonAnalysisController(BaseController):
|
||||
symbols=self.similar,
|
||||
timeframe=ns_parser.s_timeframe,
|
||||
quarter=ns_parser.b_quarter,
|
||||
export=ns_parser.export,
|
||||
)
|
||||
|
||||
@log_start_end(log=logger)
|
||||
|
||||
@@ -246,36 +246,31 @@ def get_sean_seah_warnings(
|
||||
df_financials = df_financials.set_index("Item")
|
||||
|
||||
# Create dataframe to compute meaningful metrics from sean seah book
|
||||
df_sean_seah = df_sean_seah.append(
|
||||
df_financials.loc[
|
||||
[
|
||||
"Total Shareholders' Equity",
|
||||
"Liabilities & Shareholders' Equity",
|
||||
"Long-Term Debt",
|
||||
]
|
||||
]
|
||||
)
|
||||
transfer_cols = [
|
||||
"Total Shareholders' Equity",
|
||||
"Liabilities & Shareholders' Equity",
|
||||
"Long-Term Debt",
|
||||
]
|
||||
df_sean_seah = pd.concat([df_sean_seah, df_financials.loc[transfer_cols]])
|
||||
|
||||
# Clean these metrics by parsing their values to float
|
||||
df_sean_seah = df_sean_seah.applymap(lambda x: lambda_clean_data_values_to_float(x))
|
||||
df_sean_seah = df_sean_seah.T
|
||||
|
||||
# Add additional necessary metrics
|
||||
series = (
|
||||
df_sean_seah.loc["Net Income"] / df_sean_seah.loc["Total Shareholders' Equity"]
|
||||
df_sean_seah["ROE"] = (
|
||||
df_sean_seah["Net Income"] / df_sean_seah["Total Shareholders' Equity"]
|
||||
)
|
||||
series.name = "ROE"
|
||||
df_sean_seah = df_sean_seah.append(series)
|
||||
|
||||
series = df_sean_seah.loc["EBITDA"] / df_sean_seah.loc["Interest Expense"]
|
||||
series.name = "Interest Coverage Ratio"
|
||||
df_sean_seah = df_sean_seah.append(series)
|
||||
|
||||
series = (
|
||||
df_sean_seah.loc["Net Income"]
|
||||
/ df_sean_seah.loc["Liabilities & Shareholders' Equity"]
|
||||
df_sean_seah["Interest Coverage Ratio"] = (
|
||||
df_sean_seah["EBITDA"] / df_sean_seah["Interest Expense"]
|
||||
)
|
||||
series.name = "ROA"
|
||||
df_sean_seah = df_sean_seah.append(series)
|
||||
|
||||
df_sean_seah["ROA"] = (
|
||||
df_sean_seah["Net Income"] / df_sean_seah["Liabilities & Shareholders' Equity"]
|
||||
)
|
||||
df_sean_seah = df_sean_seah.sort_index()
|
||||
df_sean_seah = df_sean_seah.T
|
||||
|
||||
n_warnings = 0
|
||||
warnings = []
|
||||
|
||||
@@ -285,6 +285,7 @@ def test_call_func_expect_queue(expected_queue, queue, func):
|
||||
symbols=["MOCK_SIMILAR_1", "MOCK_SIMILAR_2"],
|
||||
timeframe="MOCK_TIMEFRAME",
|
||||
quarter=True,
|
||||
export="",
|
||||
),
|
||||
),
|
||||
(
|
||||
@@ -299,6 +300,7 @@ def test_call_func_expect_queue(expected_queue, queue, func):
|
||||
symbols=["MOCK_SIMILAR_1", "MOCK_SIMILAR_2"],
|
||||
timeframe="MOCK_TIMEFRAME",
|
||||
quarter=True,
|
||||
export="csv",
|
||||
),
|
||||
),
|
||||
(
|
||||
@@ -313,6 +315,7 @@ def test_call_func_expect_queue(expected_queue, queue, func):
|
||||
symbols=["MOCK_SIMILAR_1", "MOCK_SIMILAR_2"],
|
||||
timeframe="MOCK_TIMEFRAME",
|
||||
quarter=True,
|
||||
export="csv",
|
||||
),
|
||||
),
|
||||
(
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Ticker to get similar companies from:
|
||||
|
||||
[unvl] tsne run TSNE on all SP500 stocks and returns closest tickers[/unvl] [YahooFinance]
|
||||
[unvl] get stocks/ca/get[/unvl] [Finviz, Polygon, Finnhub]
|
||||
[unvl] get get similar stocks[/unvl] [Finviz, Polygon, Finnhub]
|
||||
|
||||
set reset and set similar companies
|
||||
add add more similar companies
|
||||
|
||||
Reference in New Issue
Block a user