From 90fe23b400b99c0c84e4920ee28221e1372b622e Mon Sep 17 00:00:00 2001 From: Colin Delahunty <72827203+colin99d@users.noreply.github.com> Date: Thu, 18 Aug 2022 09:51:45 -0400 Subject: [PATCH] Fixes Forex Quote (#2350) * Fixed bug * Started fixing codespell * Fixed more codespell * Updated local codespell * More codespell fixes * More codespell fixes * Fixing test --- .github/workflows/test.yml | 2 +- .pre-commit-config.yaml | 4 ++-- openbb_terminal/README.md | 2 +- openbb_terminal/common/behavioural_analysis/reddit_model.py | 2 +- openbb_terminal/common/quantitative_analysis/qa_model.py | 5 ++++- openbb_terminal/economy/yfinance_model.py | 2 +- openbb_terminal/forex/av_view.py | 6 +++++- .../stocks/technical_analysis/tradingview_view.py | 2 +- routines/example.openbb | 4 ++-- website/content/terminal/common/qa/decompose/_index.md | 2 +- website/content/terminal/common/ta/recom/_index.md | 2 +- website/content/terminal/crypto/dd/_index.md | 6 +++--- website/content/terminal/crypto/defi/_index.md | 2 +- website/content/terminal/stocks/dd/_index.md | 2 +- website/content/terminal/stocks/fa/fraud/_index.md | 2 +- .../content/terminal/stocks/options/pricing/rnval/_index.md | 2 +- 16 files changed, 27 insertions(+), 20 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3c27be7ab28..04577e772a7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,7 +32,7 @@ jobs: - run: pip install types-pytz types-requests types-termcolor types-tabulate types-PyYAML types-python-dateutil types-setuptools types-six - run: bandit -x ./tests -r . || true - run: black --diff --check . - - run: codespell --ignore-words-list=zlot,ba,buil,coo,ether,hist,hsi,mape,navagation,operatio,pres,ser,yeld,shold,ist,varian,datas,ake,creat,vie,hel --quiet-level=2 --skip=./tests,.git,*.css,*.csv,*.html,*.ini,*.ipynb,*.js,*.json,*.lock,*.scss,*.txt,*.yaml,./build/pyinstaller + - run: codespell --ignore-words-list=commun,ro,zar,zlot,ba,buil,coo,ether,hist,hsi,mape,navagation,operatio,pres,ser,yeld,shold,ist,varian,datas,ake,creat,vie,hel --quiet-level=2 --skip=./tests,.git,*.css,*.csv,*.html,*.ini,*.ipynb,*.js,*.json,*.lock,*.scss,*.txt,*.yaml,./build/pyinstaller - run: flake8 . --count --ignore=E203,W503 --max-line-length=122 --show-source --statistics --exclude ./build/pyinstaller - run: mypy --ignore-missing-imports --exclude="/setup\.py$" . - run: shopt -s globstar && pyupgrade --py38-plus **/*.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 670789d24bc..7c29597da29 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,13 +32,13 @@ repos: - id: flake8 entry: flake8 --ignore=E203,W503 --max-line-length=122 --exclude ./build/pyinstaller/* - repo: https://github.com/codespell-project/codespell - rev: v2.1.0 + rev: v2.2.0 hooks: - id: codespell entry: codespell args: [ - "--ignore-words-list=vie,hel,zlot,ba,buil,coo,ether,hist,hsi,mape,navagation,operatio,pres,ser,yeld,shold,ist,varian,datas,ake,creat", + "--ignore-words-list=commun,ro,zar,vie,hel,zlot,ba,buil,coo,ether,hist,hsi,mape,navagation,operatio,pres,ser,yeld,shold,ist,varian,datas,ake,creat", "--quiet-level=2", "--skip=./tests,.git,*.css,*.csv,*.html,*.ini,*.ipynb,*.js,*.json,*.lock,*.scss,*.txt,*.yaml,build/pyinstaller/*", ] diff --git a/openbb_terminal/README.md b/openbb_terminal/README.md index dd8a93f24aa..a617e1b1f83 100644 --- a/openbb_terminal/README.md +++ b/openbb_terminal/README.md @@ -378,7 +378,7 @@ There are a few things that still don't work, and you can see what works and wha poetry install ``` -11. Ready to rock on a Raspbery Pi! +11. Ready to rock on a Raspberry Pi! ```bash python terminal.py diff --git a/openbb_terminal/common/behavioural_analysis/reddit_model.py b/openbb_terminal/common/behavioural_analysis/reddit_model.py index 57e96bb90a3..1b554300fe7 100644 --- a/openbb_terminal/common/behavioural_analysis/reddit_model.py +++ b/openbb_terminal/common/behavioural_analysis/reddit_model.py @@ -570,7 +570,7 @@ def get_wsb_community( def get_due_dilligence( ticker: str, limit: int = 5, n_days: int = 3, show_all_flairs: bool = False ) -> List[praw.models.reddit.submission.Submission]: - """Gets due dilligence posts from list of subreddits [Source: reddit] + """Gets due diligence posts from list of subreddits [Source: reddit] Parameters ---------- diff --git a/openbb_terminal/common/quantitative_analysis/qa_model.py b/openbb_terminal/common/quantitative_analysis/qa_model.py index 90b2f1c59b5..bfdac62817b 100644 --- a/openbb_terminal/common/quantitative_analysis/qa_model.py +++ b/openbb_terminal/common/quantitative_analysis/qa_model.py @@ -167,7 +167,10 @@ def get_unitroot( # Wrap this in catch_warnings to prevent with warnings.catch_warnings(): warnings.simplefilter("ignore") - res2 = kpss(data, regression=kpss_reg, nlags="auto") + try: + res2 = kpss(data, regression=kpss_reg, nlags="auto") + except ValueError: + return pd.DataFrame() vals2 = [res2[0], res2[1], res2[2], "", ""] data["KPSS"] = vals2 return data diff --git a/openbb_terminal/economy/yfinance_model.py b/openbb_terminal/economy/yfinance_model.py index 033e6975252..47c9e5c5445 100644 --- a/openbb_terminal/economy/yfinance_model.py +++ b/openbb_terminal/economy/yfinance_model.py @@ -63,7 +63,7 @@ INDICES = { "se_omx30": {"name": "OMX Stockholm 30 Index (SEK)", "ticker": "^OMX"}, "se_omxspi": {"name": "OMX Stockholm All Share PI (SEK)", "ticker": "^OMXSPI"}, "se_benchmark": {"name": "OMX Stockholm Benchmark GI (SEK)", "ticker": "^OMXSBGI"}, - "dk_benchmark": {"name": "OMX Copenhagen Benchamrk GI (DKK)", "ticker": "^OMXCBGI"}, + "dk_benchmark": {"name": "OMX Copenhagen Benchmark GI (DKK)", "ticker": "^OMXCBGI"}, "dk_omxc25": {"name": "OMX Copenhagen 25 Index (DKK)", "ticker": "^OMXC25"}, "fi_omxh25": {"name": "OMX Helsinki 25 (EUR)", "ticker": "^OMXH25"}, "de_dax40": {"name": "DAX Performance Index (EUR)", "ticker": "^GDAXI"}, diff --git a/openbb_terminal/forex/av_view.py b/openbb_terminal/forex/av_view.py index f5542deaef9..be8b8e0860d 100644 --- a/openbb_terminal/forex/av_view.py +++ b/openbb_terminal/forex/av_view.py @@ -39,7 +39,11 @@ def display_quote(to_symbol: str, from_symbol: str): ) return - df = pd.DataFrame.from_dict(quote) + try: + df = pd.DataFrame.from_dict(quote) + except ValueError: + console.print(f"[red]{quote['Information']}[/red]\n") + return df.index = df.index.to_series().apply(lambda x: x[3:]).values df = df.iloc[[0, 2, 5, 4, 7, 8]] print_rich_table( diff --git a/openbb_terminal/stocks/technical_analysis/tradingview_view.py b/openbb_terminal/stocks/technical_analysis/tradingview_view.py index 7daab1084e7..79511b7dfed 100644 --- a/openbb_terminal/stocks/technical_analysis/tradingview_view.py +++ b/openbb_terminal/stocks/technical_analysis/tradingview_view.py @@ -48,6 +48,6 @@ def print_recommendation( print_rich_table( recom, headers=list(recom.columns), - title="Ticker Recomendation", + title="Ticker Recommendation", show_index=True, ) diff --git a/routines/example.openbb b/routines/example.openbb index 7e59b3e4e6c..69e4cb4b4a4 100644 --- a/routines/example.openbb +++ b/routines/example.openbb @@ -4,7 +4,7 @@ stocks # Load Palantir Technologies (PLTR) load pltr -# Enter the Due Dilligence (dd) menu +# Enter the Due Diligence (dd) menu dd # Show price targets, both the chart and the table @@ -24,4 +24,4 @@ stats fib # Return to home -/ \ No newline at end of file +/ diff --git a/website/content/terminal/common/qa/decompose/_index.md b/website/content/terminal/common/qa/decompose/_index.md index 03737bb3d72..9900aa35be0 100755 --- a/website/content/terminal/common/qa/decompose/_index.md +++ b/website/content/terminal/common/qa/decompose/_index.md @@ -2,7 +2,7 @@ usage: decompose [-m] [--export {csv,json,xlsx}] [-h] ``` -This type of forcasting attempts to separate and index factors thought to have meaningful impact on the otherwise random movements in stock prices. +This type of forecasting attempts to separate and index factors thought to have meaningful impact on the otherwise random movements in stock prices. Decompose time series as: - Additive Time Series = Level + CyclicTrend + Residual + Seasonality diff --git a/website/content/terminal/common/ta/recom/_index.md b/website/content/terminal/common/ta/recom/_index.md index 271c91d51a4..f8c9b9102ea 100755 --- a/website/content/terminal/common/ta/recom/_index.md +++ b/website/content/terminal/common/ta/recom/_index.md @@ -22,7 +22,7 @@ optional arguments: Example: ``` 2022 Feb 16, 11:31 (✨) /stocks/ta/ $ recom - Ticker Recomendation + Ticker Recommendation ┏━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━┳━━━━━━┳━━━━━━━━━┓ ┃ ┃ RECOMMENDATION ┃ BUY ┃ SELL ┃ NEUTRAL ┃ ┡━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━╇━━━━━━╇━━━━━━━━━┩ diff --git a/website/content/terminal/crypto/dd/_index.md b/website/content/terminal/crypto/dd/_index.md index fed961f5bd2..ecde9da451b 100644 --- a/website/content/terminal/crypto/dd/_index.md +++ b/website/content/terminal/crypto/dd/_index.md @@ -1,7 +1,7 @@ --- -title: Introduction to Cryptocurrency Due Dilligence -keywords: "cryptocurrency, dd, due dilligence, tokenomics, overview, bitcoin" -excerpt: "An Introduction to Cryptocurrency Due Dilligence, within the Cryptocurrency Menu, +title: Introduction to Cryptocurrency Due Diligence +keywords: "cryptocurrency, dd, due diligence, tokenomics, overview, bitcoin" +excerpt: "An Introduction to Cryptocurrency Due Diligence, within the Cryptocurrency Menu, with a brief overview of the features." geekdocCollapseSection: true --- diff --git a/website/content/terminal/crypto/defi/_index.md b/website/content/terminal/crypto/defi/_index.md index f7617f68438..045f58dea51 100644 --- a/website/content/terminal/crypto/defi/_index.md +++ b/website/content/terminal/crypto/defi/_index.md @@ -8,7 +8,7 @@ geekdocCollapseSection: true The Cryptocurrency Decentralized Finance (DeFi) menu gives the user the ability to delve deeper into Uniswap statistics (tokens, stats and pairs), information about dApps (gdapps and stvl) -as well as infomration about terra blockchain (sreturn) and luna (lcsc). +as well as information about terra blockchain (sreturn) and luna (lcsc). ## How to use diff --git a/website/content/terminal/stocks/dd/_index.md b/website/content/terminal/stocks/dd/_index.md index 4faacbd0e49..9dba6223787 100755 --- a/website/content/terminal/stocks/dd/_index.md +++ b/website/content/terminal/stocks/dd/_index.md @@ -1,6 +1,6 @@ --- title: Introduction to the Due Diligence Menu -keywords: "dd, due, diligence, dilligence, research, company, ticker, analyst, rating, rot, pt, est, sec, supplier, customer, arktrades, ratings, analysts, filings, form, forms, customers, suppliers" +keywords: "dd, due, diligence, research, company, ticker, analyst, rating, rot, pt, est, sec, supplier, customer, arktrades, ratings, analysts, filings, form, forms, customers, suppliers" date: "2022-06-01" type: guides status: publish diff --git a/website/content/terminal/stocks/fa/fraud/_index.md b/website/content/terminal/stocks/fa/fraud/_index.md index bebf4063572..fb83d0aac91 100755 --- a/website/content/terminal/stocks/fa/fraud/_index.md +++ b/website/content/terminal/stocks/fa/fraud/_index.md @@ -5,7 +5,7 @@ usage: fraud [-h] [-d] [-e] [--export {csv,json,xlsx}] ``` optional arguments: -e, --explanation whether to show the description for the metrics (default: false) - -d, --detail show detials on the calculation of mscore + -d, --detail show details on the calculation of mscore -h, --help show this help message --export {csv,json,xlsx} Export raw data into csv, json, xlsx diff --git a/website/content/terminal/stocks/options/pricing/rnval/_index.md b/website/content/terminal/stocks/options/pricing/rnval/_index.md index febea78505e..d105c8cf775 100644 --- a/website/content/terminal/stocks/options/pricing/rnval/_index.md +++ b/website/content/terminal/stocks/options/pricing/rnval/_index.md @@ -14,7 +14,7 @@ For example, if you assume the price of AAPL has an equal chance of finishing at $100 or $200 for a given expiration, you could use this to value an option at that expiration. To value a call with a strike of $150, you would calculate the payoff for each stock price, -which would be $0 and $50. Then, we caclulate the weighted average +which would be $0 and $50. Then, we calculate the weighted average payoff of $25. We need to divide this amount by the risk-free rate, assumed to be 0.02. So the value of this option expiring in one year is 25/1.02, or $24.51.