diff options
author | Chavithra PARANA <chavithra@gmail.com> | 2022-11-28 18:19:07 +0100 |
---|---|---|
committer | Chavithra PARANA <chavithra@gmail.com> | 2022-11-28 18:19:07 +0100 |
commit | a4fce79bf7f151f25d32ac4f26c10430f888e22d (patch) | |
tree | 2112bfda7241b13b5929640d17c06893518ea1d1 | |
parent | 69cb64d24f937911dde7b245a23faa3458decd82 (diff) | |
parent | d2622528e596430358ec55b61c5e003d1416e49f (diff) |
Merge branch 'main' of github.com:OpenBB-finance/OpenBBTerminal
72 files changed, 7115 insertions, 7119 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8013f9608c6..74b41db9548 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -69,23 +69,14 @@ jobs: - name: Install dependencies if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - run: poetry install --no-interaction --no-root - - - name: Install Extra Doc - run: poetry install --no-interaction -E doc - - - name: Install Extra Optimization run: poetry install --no-interaction -E optimization - - name: Run Extra prediction - run: poetry install --no-interaction -E prediction - - name: Run tests env: MPLBACKEND: Agg run: | source $VENV - pytest tests/ --autodoc + pytest tests/ --optimization - name: Start Terminal and exit run: | @@ -141,10 +132,7 @@ jobs: - name: Install dependencies if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - run: poetry install --no-interaction --no-root - - - name: Install Package - run: poetry install --no-interaction -E doc + run: poetry install --no-interaction -E optimization - name: List installed packages shell: bash -l {0} @@ -157,7 +145,7 @@ jobs: MPLBACKEND: Agg run: | source $VENV - pytest tests/ + pytest tests/ --optimization - name: Start Terminal and exit run: | @@ -251,7 +239,6 @@ jobs: shell: bash -l {0} run: | pip install --requirement requirements-full.txt - pip install docstring_parser - name: List installed packages (Bash) shell: bash -l {0} @@ -263,7 +250,7 @@ jobs: env: MPLBACKEND: Agg shell: bash -l {0} - run: pytest tests/ -m "not linux" + run: pytest tests/ -m "not linux" --optimization - name: Start Terminal and exit shell: bash -l {0} diff --git a/README.md b/README.md index 8433c9c75c4..d0492f8044e 100644 --- a/README.md +++ b/README.md @@ -98,14 +98,15 @@ If you wish to install the OpenBB Terminal or the OpenBB SDK, please use one of |**OpenBB Terminal**|**Usage**| |:-|:-| -|[Installer](https://docs.openbb.co/terminal/quickstart/installation)|Recommended way if you just want to use the OpenBB Terminal| -|[Docker](https://docs.openbb.co/terminal/quickstart/installation)|An alternative way if you just want to use the OpenBB Terminal| -|[Python](https://docs.openbb.co/terminal/quickstart/installation)|If you wish to contribute to the development of the OpenBB Terminal| +|[Windows Installer](https://docs.openbb.co/terminal/quickstart/installation?tab=windows)|Recommended way for Windows if you just want to use the OpenBB Terminal| +|[MacOS Installer](https://docs.openbb.co/terminal/quickstart/installation?tab=mac)|Recommended way for MacOS if you just want to use the OpenBB Terminal| +|[Docker](https://docs.openbb.co/terminal/quickstart/installation?tab=docker)|An alternative way if you just want to use the OpenBB Terminal| +|[Python](https://docs.openbb.co/terminal/quickstart/installation?tab=python)|If you wish to contribute to the development of the OpenBB Terminal| |**OpenBB SDK** |**Usage**| |:-|:-| |[PyPi](https://docs.openbb.co/sdk/quickstart/installation)|Recommended way if you just want to use the OpenBB SDK| -|[Python](https://docs.openbb.co/sdk/quickstart/installation)|If you wish to contribute to the development of the OpenBB SDK | +|[Python](https://docs.openbb.co/terminal/quickstart/installation?tab=python)|If you wish to contribute to the development of the OpenBB SDK | ## 3. Contributing diff --git a/openbb_terminal/dashboards/dashboards_controller.py b/openbb_terminal/dashboards/dashboards_controller.py index e81b7dd9d16..0b657707457 100644 --- a/openbb_terminal/dashboards/dashboards_controller.py +++ b/openbb_terminal/dashboards/dashboards_controller.py @@ -155,7 +155,7 @@ def create_call_voila(other_args: List[str], name: str, filename: str = None) -> console.print( f"Warning: opens a port on your computer to run a {cmd} server." ) - response = input("Would you like us to run the server for you? y/n\n") + response = input("Would you like us to run the server for you [yn]? ") args = "" if ns_parser.dark and not ns_parser.jupyter: args += "--theme=dark" @@ -201,7 +201,7 @@ def create_call_streamlit( console.print( f"Warning: opens a port on your computer to run a {cmd} server." ) - response = input("Would you like us to run the server for you? y/n\n") + response = input("Would you like us to run the server for you [yn]? ") args = "" if ns_parser.input or response.lower() == "y": subprocess.Popen( diff --git a/openbb_terminal/economy/economy_controller.py b/openbb_terminal/economy/economy_controller.py index aed486baece..152a705de89 100644 --- a/openbb_terminal/economy/economy_controller.py +++ b/openbb_terminal/economy/economy_controller.py @@ -1034,7 +1034,9 @@ class EconomyController(BaseController): if country == "united states": fred_view.display_yield_curve( - ns_parser.date, + date=ns_parser.date.strftime("%Y-%m-%d") + if ns_parser.date + else None, raw=ns_parser.raw, export=ns_parser.export, ) diff --git a/openbb_terminal/economy/fred_model.py b/openbb_terminal/economy/fred_model.py index 0f2b44bbe53..3f8dc3fba90 100644 --- a/openbb_terminal/economy/fred_model.py +++ b/openbb_terminal/economy/fred_model.py @@ -256,18 +256,18 @@ def get_aggregated_series_data( @log_start_end(log=logger) @check_api_key(["API_FRED_KEY"]) def get_yield_curve( - date: datetime = None, -) -> Tuple[pd.DataFrame, datetime]: + date: str = None, +) -> Tuple[pd.DataFrame, str]: """Gets yield curve data from FRED Parameters ---------- - date: datetime - Date to get curve for. If None, gets most recent date + date: str + Date to get curve for. If None, gets most recent date (format yyyy-mm-dd) Returns ------- - Tuple[pd.DataFrame, datetime] + Tuple[pd.DataFrame, str] Dataframe of yields and maturities, Date for which the yield curve is obtained @@ -300,17 +300,13 @@ def get_yield_curve( df = pd.DataFrame() if date is None: - date_to_get = (datetime.now() - timedelta(days=7)).strftime("%Y-%m-%d") - else: - date_to_get = date.strftime("%Y-%m-%d") + date = (datetime.now() - timedelta(days=7)).strftime("%Y-%m-%d") for key, s_id in fred_series.items(): df = pd.concat( [ df, - pd.DataFrame( - fredapi_client.get_series(s_id, date_to_get), columns=[key] - ), + pd.DataFrame(fredapi_client.get_series(s_id, date), columns=[key]), ], axis=1, ) diff --git a/openbb_terminal/economy/fred_view.py b/openbb_terminal/economy/fred_view.py index c362d726eec..033a74b5bee 100644 --- a/openbb_terminal/economy/fred_view.py +++ b/openbb_terminal/economy/fred_view.py @@ -5,7 +5,6 @@ import logging import os import textwrap from typing import Optional, List, Tuple -from datetime import datetime import matplotlib.pyplot as plt import numpy as np @@ -186,7 +185,7 @@ def format_data_to_plot(data: pd.DataFrame, detail: dict) -> Tuple[pd.DataFrame, @log_start_end(log=logger) @check_api_key(["API_FRED_KEY"]) def display_yield_curve( - date: datetime = None, + date: str = None, external_axes: Optional[List[plt.Axes]] = None, raw: bool = False, export: str = "", @@ -195,16 +194,18 @@ def display_yield_curve( Parameters ---------- - date: datetime - Date to get |