mypy, fixed removed load_dotenv_and_reload_configs in website\controller_doc_classes.py

This commit is contained in:
teh_coderer
2023-03-16 11:39:18 -04:00
parent 503579e6d3
commit 2e20e4607a
3 changed files with 5 additions and 4 deletions

View File

@@ -55,7 +55,7 @@ class TAIndicator:
output = opt
return output
def get_argument_values(self, label: str) -> List[Any]:
def get_argument_values(self, label: str) -> Union[List[Any], Any]:
"""Returns arguments values by label"""
output = []
options = self.get_args(label)

View File

@@ -20,7 +20,8 @@ class Custom(PltTA):
@indicator()
def plot_srlines(self, fig: OpenBBFigure, df_ta: pd.DataFrame):
"""Adds support and resistance lines to plotly figure"""
window = self.params["srlines"].get_argument_values("window") or 200
window = self.params["srlines"].get_argument_values("window")
window = window[0] if isinstance(window, list) and len(window) > 0 else 200
def is_far_from_level(value, levels, df_stock):
ave = np.mean(df_stock["High"] - df_stock["Low"])

View File

@@ -14,7 +14,7 @@ import pandas as pd
from pandas.tseries.holiday import USFederalHolidayCalendar
import openbb_terminal
from openbb_terminal.base_helpers import load_dotenv_and_reload_configs
import openbb_terminal.config_terminal as cfg # noqa: F401
from openbb_terminal.core.plots.backend import plots_backend
from openbb_terminal.decorators import disable_check_api
from openbb_terminal.helper_funcs import (
@@ -28,7 +28,7 @@ from openbb_terminal.rich_config import console
from openbb_terminal.sdk import openbb
from openbb_terminal.stocks.comparison_analysis import finviz_compare_model
load_dotenv_and_reload_configs()
cfg.start_required_configurations()
disable_check_api()
plots_backend().start()
plots_backend().isatty = True