Skip to content

Commit

Permalink
Fix linter issue (#3538)
Browse files Browse the repository at this point in the history
* Fix linter issue

* Didnt import optimization menu

* Fix some things for deployment

* openbbterminal -> openbb

* openbb
  • Loading branch information
jmaslek authored Nov 23, 2022
1 parent bb6c245 commit 649dd1d
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
run: poetry install --no-interaction --no-root

- name: Install packages
run: poetry install --no-interaction -E prediction -E doc
run: poetry install --no-interaction -E prediction -E doc -E optimization

- run: |
source $VENV
Expand Down
2 changes: 1 addition & 1 deletion openbb_terminal/SDK_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ conda activate obb
#### 4. **Install OpenBB SDK Core package**

```bash
pip install openbbterminal
pip install openbb
```

#### 5. **(Optional) Install the Toolkits**
Expand Down
61 changes: 30 additions & 31 deletions openbb_terminal/cryptocurrency/cryptocurrency_helpers.py
Original file line number Diff line number Diff line change
@@ -1,40 +1,39 @@
"""Cryptocurrency helpers"""
# pylint: disable=too-many-lines,too-many-return-statements

from __future__ import annotations

import os
import json
from datetime import datetime, timedelta
import difflib
import json
import logging
import os
from datetime import datetime, timedelta
from typing import Union

import pandas as pd
import numpy as np
import ccxt
import matplotlib.pyplot as plt
from matplotlib.ticker import LogLocator, ScalarFormatter
import yfinance as yf
import mplfinance as mpf
import numpy as np
import pandas as pd
import yfinance as yf
from matplotlib.ticker import LogLocator, ScalarFormatter
from pycoingecko import CoinGeckoAPI

from openbb_terminal.helper_funcs import (
lambda_long_number_format,
plot_autoscale,
export_data,
print_rich_table,
lambda_long_number_format_y_axis,
is_valid_axes_count,
)
from openbb_terminal.config_plot import PLOT_DPI
from openbb_terminal.config_terminal import theme
from openbb_terminal.rich_config import console
from openbb_terminal.cryptocurrency.due_diligence import coinpaprika_model
from openbb_terminal.cryptocurrency.discovery import pycoingecko_model
from openbb_terminal.cryptocurrency.due_diligence import coinpaprika_model
from openbb_terminal.cryptocurrency.due_diligence.pycoingecko_model import (
get_ohlc,
get_coin_tokenomics,
get_ohlc,
)
from openbb_terminal.helper_funcs import (
export_data,
is_valid_axes_count,
lambda_long_number_format,
lambda_long_number_format_y_axis,
plot_autoscale,
print_rich_table,
)
from openbb_terminal.rich_config import console

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -115,13 +114,13 @@


def check_datetime(
ck_date: datetime | str | None = None, start: bool = True
ck_date: Union[datetime, Union[str, None]] = None, start: bool = True
) -> datetime:
"""Checks if given argument is string and attempts to convert to datetime.
Parameters
----------
ck_date : Optional[Union[datetime, str]], optional
ck_date : Union[datetime, Union[str, None]], optional
Date to check, by default None
start : bool, optional
If True and string is invalid, will return 1100 days ago
Expand Down Expand Up @@ -488,11 +487,11 @@ def load_from_yahoofinance(

def load(
symbol: str,
start_date: datetime | str | None = None,
interval: str | int = "1440",
start_date: Union[datetime, Union[str, None]] = None,
interval: Union[str, int] = "1440",
exchange: str = "binance",
vs_currency: str = "usdt",
end_date: datetime | str | None = None,
end_date: Union[datetime, Union[str, None]] = None,
source: str = "CCXT",
) -> pd.DataFrame:
"""Load crypto currency to get data for
Expand All @@ -501,16 +500,16 @@ def load(
----------
symbol: str
Coin to get
start_date: str or datetime, optional
start_date: Union[datetime, Union[str, None]], optional
Start date to get data from with. - datetime or string format (YYYY-MM-DD)
interval: str|int
interval: Union[str, int]
The interval between data points in minutes.
Choose from: 1, 15, 30, 60, 240, 1440, 10080, 43200
exchange: str:
The exchange to get data from.
vs_currency: str
Quote Currency (Defaults to usdt)
end_date: str or datetime, optional
end_date: Union[datetime, Union[str, None]], optional
End date to get data from with. - datetime or string format (YYYY-MM-DD)
source: str
The source of the data
Expand Down Expand Up @@ -752,7 +751,7 @@ def plot_chart(
source: str = "",
exchange: str = "",
interval: str = "",
external_axes: list[plt.Axes] | None = None,
external_axes: Union[list[plt.Axes], None] = None,
yscale: str = "linear",
) -> None:
"""Load data for Technical Analysis
Expand Down Expand Up @@ -802,7 +801,7 @@ def plot_candles(
volume: bool = True,
ylabel: str = "",
title: str = "",
external_axes: list[plt.Axes] | None = None,
external_axes: Union[list[plt.Axes], None] = None,
yscale: str = "linear",
) -> None:
"""Plot candle chart from dataframe. [Source: Binance]
Expand Down Expand Up @@ -882,7 +881,7 @@ def plot_order_book(
bids: np.ndarray,
asks: np.ndarray,
coin: str,
external_axes: list[plt.Axes] | None = None,
external_axes: Union[list[plt.Axes], None] = None,
) -> None:
"""
Plots Bid/Ask. Can be used for Coinbase and Binance
Expand Down
9 changes: 4 additions & 5 deletions openbb_terminal/stocks/options/chartexchange_model.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
"""Chartexchange model"""

from __future__ import annotations

import logging
from typing import Union

import pandas as pd
import requests
Expand All @@ -21,19 +20,19 @@ def get_option_history(
symbol: str = "GME",
date: str = "2021-02-05",
call: bool = True,
price: str | int | float = "90",
price: Union[str, Union[int, float]] = "90",
) -> pd.DataFrame:
"""Historic prices for a specific option [chartexchange]
Parameters
----------
symbol : str
Ticker symbol to get historical data from
date : str|int|float
date : str
Date as a string YYYYMMDD
call : bool
Whether to show a call or a put
price : str
price : Union[str, Union[int, float]]
Strike price for a specific option
Returns
Expand Down
16 changes: 8 additions & 8 deletions openbb_terminal/stocks/options/options_sdk_helper.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
"""Options Functions For OpenBB SDK"""

from __future__ import annotations

import logging
from typing import Union

import pandas as pd

from openbb_terminal.decorators import log_start_end
from openbb_terminal.stocks.options import (
chartexchange_model,
nasdaq_model,
tradier_model,
yfinance_model,
chartexchange_model,
)
from openbb_terminal.decorators import log_start_end

logger = logging.getLogger(__name__)


@log_start_end(log=logger)
def get_full_option_chain(
symbol: str, source: str = "Nasdaq", expiration: str | None = None
symbol: str, source: str = "Nasdaq", expiration: Union[str, None] = None
) -> pd.DataFrame:
"""Get Option Chain For A Stock. No greek data is returned
Expand All @@ -28,7 +28,7 @@ def get_full_option_chain(
Symbol to get chain for
source : str, optional
Source to get data from, by default "Nasdaq"
expiration : str, optional
expiration : Union[str, None], optional
Date to get chain for. By default returns all dates
Returns
Expand Down Expand Up @@ -101,7 +101,7 @@ def get_option_expirations(symbol: str, source: str = "Nasdaq") -> list:
def hist(
symbol: str,
exp: str,
strike: int | float | str,
strike: Union[int, Union[float, str]],
call: bool = True,
source="ChartExchange",
) -> pd.DataFrame:
Expand All @@ -113,7 +113,7 @@ def hist(
Symbol to get data for
exp : str
Expiration date
strike : int | float | str
strike : Union[int ,Union[float,str]]
Strike price
call : bool, optional
Flag to indicate a call, by default True
Expand Down
3 changes: 2 additions & 1 deletion openbb_terminal/terminal_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ def check_for_updates() -> None:

if current_version_number == latest_version_number:
console.print("[green]You are using the latest stable version[/green]")
return
else:
console.print(
"[yellow]You are not using the latest stable version[/yellow]"
Expand All @@ -237,10 +236,12 @@ def check_for_updates() -> None:
console.print(
"[yellow]Check for updates at https://openbb.co/products/terminal#get-started[/yellow]"
)

else:
console.print(
"[yellow]You are using an unreleased version[/yellow]"
)

else:
console.print("[red]You are using an unrecognized version.[/red]")
else:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.poetry]
name = "OpenBBTerminal"
name = "openbb"
version = "2.0.0rc1"
description = "Investment Research for Everyone, Anywhere."
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion website/content/sdk/quickstart/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ conda activate obb
### 4. **Install OpenBB SDK Core package**

```bash
pip install openbbterminal
pip install openbb
```

### 5. **(Optional) Install the Toolkits**
Expand Down

0 comments on commit 649dd1d

Please sign in to comment.