diff --git a/openbb_terminal/core/library/breadcrumb.py b/openbb_terminal/core/library/breadcrumb.py index ef2feb76c9d4..49505721ed59 100644 --- a/openbb_terminal/core/library/breadcrumb.py +++ b/openbb_terminal/core/library/breadcrumb.py @@ -5,10 +5,12 @@ from openbb_terminal.core.library.trail_map import TrailMap from openbb_terminal.core.library.operation import Operation +# pylint: disable=import-outside-toplevel + class MetadataBuilder: @staticmethod - def build_dir_list(trail: str, trail_map: TrailMap) -> List[str]: + def get_option_list(trail: str, trail_map: TrailMap) -> List[str]: option_list = [] for key in trail_map.map_dict: if trail == "": @@ -23,30 +25,44 @@ def build_dir_list(trail: str, trail_map: TrailMap) -> List[str]: return list(set(option_list)) + @classmethod + def build_dir_list(cls, trail: str, trail_map: TrailMap) -> List[str]: + option_list = cls.get_option_list(trail=trail, trail_map=trail_map) + + option_list_full = [] + for option in option_list: + option_list_full.append(option) + + option_view_trail = f"{trail}.{option}_chart" + if trail_map.get_view_function(trail=option_view_trail): + option_list_full.append(f"{option}_chart") + + return option_list_full + @staticmethod - def build_doc_string(trail: str, dir_list: List[str]) -> str: + def build_docstring(trail: str, dir_list: List[str]) -> str: if trail == "": - doc_string = """This is the OpenBB Terminal SDK. + docstring = """This is the OpenBB Terminal SDK. Use the SDK to get data directly into your jupyter notebook or directly use it in your application. For more information see the official documentation at: https://openbb-finance.github.io/OpenBBTerminal/SDK/ """ else: - doc_string = ( + docstring = ( trail.rsplit(".")[-1].upper() + " Menu\n\nThe SDK commands of the the menu:" ) for command in dir_list: - doc_string += f"\n\t.{trail}.{command}" + docstring += f"\n\t.{trail}.{command}" - return doc_string + return docstring @classmethod def build(cls, trail: str, trail_map: TrailMap) -> Metadata: dir_list = cls.build_dir_list(trail=trail, trail_map=trail_map) - doc_string = cls.build_doc_string(trail=trail, dir_list=dir_list) + docstring = cls.build_docstring(trail=trail, dir_list=dir_list) metadata = Metadata( dir_list=dir_list, - doc_string=doc_string, + docstring=docstring, ) return metadata @@ -83,7 +99,7 @@ def __init__( self._trail_map = trail_map self._trail = trail - self.__doc__ = metadata.doc_string + self.__doc__ = metadata.docstring if trail == "": BreadcrumbLogger() @@ -100,7 +116,9 @@ def __getattr__(self, name: str) -> Any: else: trail_next = f"{trail}.{name}" - if Operation.is_valid(trail=trail_next, trail_map=trail_map): + if trail_map.get_model_function( + trail=trail_next + ) or trail_map.get_view_function(trail=trail_next): next_crumb: Any = Operation( trail=trail_next, trail_map=trail_map, @@ -118,6 +136,14 @@ def __getattr__(self, name: str) -> Any: return next_crumb + def about(self): + import webbrowser + + trail = self._trail + url = "https://openbb-finance.github.io/OpenBBTerminal/SDK/" + url += "/".join(trail.split(".")) + webbrowser.open(url) + # pylint: disable=R0903 class BreadcrumbLogger: diff --git a/openbb_terminal/core/library/metadata.py b/openbb_terminal/core/library/metadata.py index 09c0f6f62c18..68e47c1db8d7 100644 --- a/openbb_terminal/core/library/metadata.py +++ b/openbb_terminal/core/library/metadata.py @@ -7,13 +7,13 @@ def dir_list(self) -> List[str]: return self.__dir_list @property - def doc_string(self) -> str: - return self.__doc_string + def docstring(self) -> str: + return self.__docstring def __init__( self, dir_list: List[str], - doc_string: str = "", + docstring: str = "", ) -> None: self.__dir_list = dir_list - self.__doc_string = doc_string + self.__docstring = docstring diff --git a/openbb_terminal/core/library/operation.py b/openbb_terminal/core/library/operation.py index 4b6b0c711912..c4587290e55f 100644 --- a/openbb_terminal/core/library/operation.py +++ b/openbb_terminal/core/library/operation.py @@ -10,48 +10,49 @@ from openbb_terminal.core.library.metadata import Metadata from openbb_terminal.core.library.trail_map import TrailMap +# pylint: disable=import-outside-toplevel + class MetadataBuilder: - def __init__(self, model: Optional[Callable], view: Optional[Callable]) -> None: - self.__model = model - self.__view = view + def __init__( + self, + method: Callable, + trail: str, + trail_map: TrailMap, + ) -> None: + self.__method = method + self.__trail = trail + self.__trail_map = trail_map @staticmethod - def build_doc_string( - model: Optional[Callable], - view: Optional[Callable], + def build_docstring( + method: Callable, + trail: str, + trail_map: TrailMap, ) -> str: - if view is not None: - view_doc = view.__doc__ or "" - model_doc = model.__doc__ or "" - index = view_doc.find("Parameters") - - all_parameters = ( - "\nSDK function, use the chart kwarg for getting the view model and it's plot. " - "See every parameter below:\n\n " - + view_doc[index:] - + """chart: bool - If the view and its chart shall be used""" - ) - doc_string = ( - all_parameters - + "\n\nModel doc:\n" - + model_doc - + "\n\nView doc:\n" - + view_doc - ) - else: - doc_string = model.__doc__ or "" + doc = "" + + view_trail = f"{trail}_chart" + if trail_map.get_view_function(view_trail): + doc += f"Use '{view_trail}' to access the view.\n" - return doc_string + if method.__doc__: + doc += method.__doc__ + + return doc def build(self) -> Metadata: - model = self.__model - view = self.__view + method = self.__method + trail = self.__trail + trail_map = self.__trail_map dir_list: List[str] = [] - docstring = self.build_doc_string(model=model, view=view) - metadata = Metadata(dir_list=dir_list, doc_string=docstring) + docstring = self.build_docstring( + method=method, + trail=trail, + trail_map=trail_map, + ) + metadata = Metadata(dir_list=dir_list, docstring=docstring) return metadata @@ -61,53 +62,9 @@ class Operation: def __get_method(method_path: str) -> Callable: module_path, function_name = method_path.rsplit(".", 1) module = import_module(module_path) - method = getattr(module, function_name) - - return method - - @classmethod - def __get_model(cls, trail: str, trail_map: TrailMap) -> Optional[Callable]: - map_dict = trail_map.map_dict - model = None - - if trail in map_dict: - if "model" in map_dict[trail] and map_dict[trail]["model"]: - model_path = map_dict[trail]["model"] - model = cls.__get_method(method_path=model_path) + func = getattr(module, function_name) - return model - - @classmethod - def __get_view(cls, trail: str, trail_map: TrailMap) -> Optional[Callable]: - map_dict = trail_map.map_dict - view = None - - if trail in map_dict: - if "view" in map_dict[trail] and map_dict[trail]["view"]: - view_path = map_dict[trail]["view"] - view = cls.__get_method(method_path=view_path) - - return view - - @staticmethod - def is_valid(trail: str, trail_map: TrailMap) -> bool: - return trail in trail_map.map_dict - - @property - def trail(self) -> str: - return self.__trail - - @property - def trail_map(self) -> TrailMap: - return self.__trail_map - - @property - def model(self) -> Optional[Callable]: - return self.__model - - @property - def view(self) -> Optional[Callable]: - return self.__view + return func def __init__( self, @@ -116,48 +73,47 @@ def __init__( metadata: Optional[Metadata] = None, ) -> None: trail_map = trail_map or TrailMap() - model = self.__get_model(trail=trail, trail_map=trail_map) - view = self.__get_view(trail=trail, trail_map=trail_map) - metadata = metadata or MetadataBuilder(model=model, view=view).build() - self.__trail = trail - self.__trail_map = trail_map - self.__model = model - self.__view = view + method_path = trail_map.get_model_or_view(trail=trail) + method = self.__get_method(method_path=method_path) + metadata = ( + metadata + or MetadataBuilder(method=method, trail=trail, trail_map=trail_map).build() + ) - self.__doc__ = metadata.doc_string + self._trail = trail + self._trail_map = trail_map + self._method = method - if model: - self.__signature__ = signature(model) + self.__doc__ = metadata.docstring + self.__signature__ = signature(method) def __call__(self, *args: Any, **kwargs: Any) -> Any: - model = self.__model - view = self.__view - - if view and "chart" in kwargs and kwargs["chart"] is True: - method_chosen = view - elif model: - method_chosen = model - else: - raise Exception("Unknown method") + method = self._method operation_logger = OperationLogger( - trail=self.__trail, - method_chosen=method_chosen, + trail=self._trail, + method_chosen=method, args=args, kwargs=kwargs, ) operation_logger.log_before_call() - if "chart" in kwargs: - kwargs.pop("chart") - method_result = method_chosen(*args, **kwargs) + method_result = method(*args, **kwargs) operation_logger.log_after_call(method_result=method_result) return method_result + def about(self): + import webbrowser + + trail = self._trail + url = "https://openbb-finance.github.io/OpenBBTerminal/SDK/" + url += "/".join(trail.split(".")) + webbrowser.open(url) + class OperationLogger: def __init__( diff --git a/openbb_terminal/core/library/trail_map.py b/openbb_terminal/core/library/trail_map.py index 007f68428005..8215382e59b8 100644 --- a/openbb_terminal/core/library/trail_map.py +++ b/openbb_terminal/core/library/trail_map.py @@ -1,5 +1,5 @@ from pathlib import Path -from typing import Dict +from typing import Dict, Optional import pandas as pd @@ -8,8 +8,6 @@ try: import darts # pylint: disable=W0611 # noqa: F401 - # If you just import darts this will pass during pip install, this creates - # Failures later on, also importing utils ensures that darts is installed correctly from darts import utils # pylint: disable=W0611 # noqa: F401 FORECASTING = True @@ -41,6 +39,49 @@ def save_csv(cls, map_dict: Dict[str, Dict[str, str]], path: Path = None) -> Non def map_dict(self) -> Dict[str, Dict[str, str]]: return self.__map_dict + def get_view_function(self, trail: str) -> Optional[str]: + """Retrieves the view function from the mapping. + + Views ends with "_chart". + + Args: + trail (str): Trail like "futures.curves_chart" + + Returns: + Optional[str]: View function import path. + """ + + map_dict = self.__map_dict + trail = trail[: -len("_chart")] + + view = None + if trail in map_dict and "view" in map_dict[trail] and map_dict[trail]["view"]: + view = map_dict[trail]["view"] + + return view + + def get_model_function(self, trail: str) -> Optional[str]: + map_dict = self.map_dict + + model = None + if trail in map_dict and "view" in map_dict[trail] and map_dict[trail]["model"]: + model = map_dict[trail]["model"] + + return model + + def get_model_or_view(self, trail: str) -> str: + model_path = self.get_model_function(trail=trail) + view_path = self.get_view_function(trail=trail) + + if model_path: + method_path = model_path + elif view_path: + method_path = view_path + else: + raise AttributeError(f"Unknown method : {trail}") + + return method_path + def load(self): map_dict = self.load_csv(path=self.MAP_PATH) if FORECASTING: diff --git a/openbb_terminal/reports/templates/crypto.ipynb b/openbb_terminal/reports/templates/crypto.ipynb index 27e1b2ab0ea8..86aa31928aed 100644 --- a/openbb_terminal/reports/templates/crypto.ipynb +++ b/openbb_terminal/reports/templates/crypto.ipynb @@ -163,7 +163,7 @@ "# alt index\n", "\n", "# fig, ax = plt.subplots(figsize=(11, 5), dpi=150)\n", - "# openbb.crypto.ov.altindex(external_axes=[ax], chart=True)\n", + "# openbb.crypto.ov.altindex_chart(external_axes=[ax])\n", "# fig.tight_layout()\n", "# f = io.BytesIO()\n", "# fig.savefig(f, format=\"svg\")\n", @@ -289,7 +289,7 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.crypto.dd.headlines(ticker, external_axes=[ax], chart=True)\n", + "openbb.crypto.dd.headlines_chart(ticker, external_axes=[ax])\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", "fig.savefig(f, format=\"svg\")\n", @@ -327,7 +327,7 @@ "outputs": [], "source": [ "fig, (ax1, ax2) = plt.subplots(nrows=2, ncols=1, figsize=(11, 5), dpi=150)\n", - "openbb.crypto.chart(\n", + "openbb.crypto.chart_chart(\n", " historical_data_one_year,\n", " to_symbol=ticker,\n", " from_symbol=\"USDT\",\n", @@ -335,7 +335,6 @@ " exchange=\"binance\",\n", " interval=\"1440\",\n", " external_axes=[ax1, ax2],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -361,7 +360,7 @@ "# market cap dominance\n", "\n", "fig, ax = plt.subplots(figsize=(11, 5), dpi=150)\n", - "openbb.crypto.dd.mcapdom(symbol=ticker, external_axes=[ax], chart=True)\n", + "openbb.crypto.dd.mcapdom_chart(symbol=ticker, external_axes=[ax])\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", "fig.savefig(f, format=\"svg\")\n", @@ -379,7 +378,7 @@ "# roadmap\n", "\n", "fig, ax = plt.subplots(figsize=(11, 5), dpi=150)\n", - "openbb.crypto.dd.rm(symbol=ticker, external_axes=[ax], chart=True)\n", + "openbb.crypto.dd.rm_chart(symbol=ticker, external_axes=[ax])\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", "fig.savefig(f, format=\"svg\")\n", @@ -410,7 +409,7 @@ "source": [ "fig, ax1 = plt.subplots(figsize=(11, 5), dpi=150)\n", "ax2 = ax1.twinx()\n", - "openbb.crypto.dd.tk(symbol=ticker, external_axes=[ax1, ax2], chart=True)\n", + "openbb.crypto.dd.tk_chart(symbol=ticker, external_axes=[ax1, ax2])\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", "fig.savefig(f, format=\"svg\")\n", @@ -560,12 +559,16 @@ "# order book\n", "\n", "fig, ax = plt.subplots(figsize=(11, 5), dpi=150)\n", - "openbb.crypto.dd.ob(symbol=ticker, exchange=\"binance\", to_symbol=\"USDT\", chart=True, external_axes=[ax])\n", + "openbb.crypto.dd.ob_chart(\n", + " symbol=ticker, exchange=\"binance\", to_symbol=\"USDT\", external_axes=[ax]\n", + ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", "fig.savefig(f, format=\"svg\")\n", "order_book = f.getvalue().decode(\"utf-8\")\n", - "order_book_raw = openbb.crypto.dd.ob(symbol=ticker, exchange=\"binance\", to_symbol=\"USDT\")" + "order_book_raw = openbb.crypto.dd.ob(\n", + " symbol=ticker, exchange=\"binance\", to_symbol=\"USDT\"\n", + ")" ] }, { @@ -657,7 +660,7 @@ "\n", "if not gh_data.empty:\n", " fig, ax = plt.subplots(figsize=(11, 5), dpi=150)\n", - " openbb.crypto.dd.gh(symbol=ticker, external_axes=[ax], chart=True)\n", + " openbb.crypto.dd.gh_chart(symbol=ticker, external_axes=[ax])\n", " fig.tight_layout()\n", " f = io.BytesIO()\n", " fig.savefig(f, format=\"svg\")\n", @@ -693,12 +696,11 @@ "ticker_data.index.names = [\"date\"]\n", "\n", "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.ta.ma(\n", + "openbb.ta.ma_chart(\n", " data=ticker_data[\"Close\"],\n", " ma_type=\"SMA\",\n", " symbol=ticker,\n", " external_axes=[ax],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -715,12 +717,11 @@ "source": [ "# exponential moving average\n", "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.ta.ma(\n", + "openbb.ta.ma_chart(\n", " data=ticker_data[\"Close\"],\n", " ma_type=\"EMA\",\n", " symbol=ticker,\n", " external_axes=[ax],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -738,12 +739,11 @@ "# zero lag exponential moving average\n", "\n", "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.ta.ma(\n", + "openbb.ta.ma_chart(\n", " data=ticker_data[\"Close\"],\n", " ma_type=\"ZLMA\",\n", " symbol=ticker,\n", " external_axes=[ax],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -761,11 +761,10 @@ "# commodity channel index\n", "\n", "fig, (ax1, ax2) = plt.subplots(nrows=2, ncols=1, figsize=(11, 5), dpi=150)\n", - "openbb.ta.cci(\n", + "openbb.ta.cci_chart(\n", " data=ticker_data,\n", " symbol=ticker,\n", " external_axes=[ax1, ax2],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -783,11 +782,10 @@ "# moving average convergence/divergence\n", "\n", "fig, (ax1, ax2) = plt.subplots(nrows=2, ncols=1, figsize=(11, 5), dpi=150)\n", - "openbb.ta.macd(\n", + "openbb.ta.macd_chart(\n", " data=ticker_data[\"Adj Close\"],\n", " symbol=ticker,\n", " external_axes=[ax1, ax2],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -806,11 +804,10 @@ "\n", "fig, (ax1, ax2) = plt.subplots(nrows=2, ncols=1, figsize=(11, 11), dpi=150)\n", "ax3 = ax2.twinx()\n", - "openbb.ta.fisher(\n", + "openbb.ta.fisher_chart(\n", " data=ticker_data,\n", " symbol=ticker,\n", " external_axes=[ax1, ax2, ax3],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -828,11 +825,10 @@ "# aroon indicator\n", "\n", "fig, (ax1, ax2, ax3) = plt.subplots(nrows=3, ncols=1, figsize=(11, 11), dpi=150)\n", - "openbb.ta.aroon(\n", + "openbb.ta.aroon_chart(\n", " data=ticker_data,\n", " symbol=ticker,\n", " external_axes=[ax1, ax2, ax3],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -850,11 +846,10 @@ "# bollinger bands\n", "\n", "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.ta.bbands(\n", + "openbb.ta.bbands_chart(\n", " data=ticker_data,\n", " symbol=ticker,\n", " external_axes=[ax],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -873,11 +868,10 @@ "\n", "fig, ax1 = plt.subplots(figsize=(11, 5), dpi=150)\n", "ax2 = ax1.twinx()\n", - "openbb.ta.fib(\n", + "openbb.ta.fib_chart(\n", " data=ticker_data,\n", " symbol=ticker,\n", " external_axes=[ax1, ax2],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -916,10 +910,9 @@ "# normality statistics and tests\n", "\n", "# fig, _ = plt.subplots(figsize=(11, 3), dpi=150)\n", - "# openbb.qa.normality(\n", + "# openbb.qa.normality_chart(\n", "# data=ticker_data,\n", "# target=\"Close\",\n", - "# chart=True,\n", "# )\n", "# fig.tight_layout()\n", "# f = io.BytesIO()\n", @@ -941,13 +934,12 @@ "# box and whisker plot\n", "\n", "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.qa.bw(\n", + "openbb.qa.bw_chart(\n", " symbol=ticker,\n", " data=ticker_data,\n", " target=\"Close\",\n", " yearly=False,\n", " external_axes=[ax],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -970,7 +962,6 @@ " data=ticker_data,\n", " target=\"Close\",\n", " external_axes=[ax1, ax2],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -993,7 +984,6 @@ " data=ticker_data,\n", " target=\"Close\",\n", " external_axes=[ax1, ax2],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", diff --git a/openbb_terminal/reports/templates/economy.ipynb b/openbb_terminal/reports/templates/economy.ipynb index 18657d6a9598..283eff9807e0 100644 --- a/openbb_terminal/reports/templates/economy.ipynb +++ b/openbb_terminal/reports/templates/economy.ipynb @@ -133,7 +133,7 @@ "fig = plt.figure(figsize=(11, 4), constrained_layout=True)\n", "spec = fig.add_gridspec(1, 2)\n", "ax1 = fig.add_subplot(spec[0, 1])\n", - "openbb.economy.rtps(external_axes=[ax1], chart=True)\n", + "openbb.economy.rtps_chart(external_axes=[ax1])\n", "ax1.set_title(\"\")\n", "ax1.set_ylabel(\"\")\n", "\n", @@ -220,7 +220,7 @@ "ycrv_country_1 = \"United states\"\n", "ycrv_data_1, _ = openbb.economy.ycrv()\n", "\n", - "openbb.economy.ycrv(external_axes=[ax1], chart=True)\n", + "openbb.economy.ycrv_chart(external_axes=[ax1])\n", "\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -265,36 +265,33 @@ "spec = fig.add_gridspec(2, 2)\n", "\n", "ax1 = fig.add_subplot(spec[0, 0])\n", - "openbb.economy.treasury(\n", + "openbb.economy.treasury_chart(\n", " instruments=[\"nominal\"],\n", " maturities=[\"2y\", \"10y\"],\n", " frequency=\"daily\",\n", " start_date=\"2020-01-01\",\n", " external_axes=[ax1],\n", - " chart=True,\n", ")\n", "ax1.set_title(\"UST 2y-10y\", loc=\"left\")\n", "\n", "ax2 = fig.add_subplot(spec[0, 1])\n", - "openbb.economy.treasury(\n", + "openbb.economy.treasury_chart(\n", " instruments=[\"nominal\"],\n", " maturities=[\"10y\", \"30y\"],\n", " frequency=\"daily\",\n", " start_date=\"2020-01-01\",\n", " external_axes=[ax2],\n", - " chart=True,\n", ")\n", "ax2.set_title(\"UST 10y-30y\", loc=\"left\")\n", "\n", "\n", "ax3 = fig.add_subplot(spec[1, :])\n", - "openbb.economy.treasury(\n", + "openbb.economy.treasury_chart(\n", " instruments=[\"nominal\", \"inflation\"],\n", " maturities=[\"10y\"],\n", " frequency=\"daily\",\n", " start_date=\"2020-01-01\",\n", " external_axes=[ax3],\n", - " chart=True,\n", ")\n", "ax3.set_title(\"Nominal vs TIPS\", loc=\"left\")\n", "\n", @@ -459,7 +456,7 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(figsize=(11, 5), dpi=150)\n", - "openbb.economy.bigmac(\n", + "openbb.economy.bigmac_chart(\n", " country_codes=[\n", " \"USA\",\n", " \"CAN\",\n", @@ -475,7 +472,6 @@ " \"GBR\",\n", " ],\n", " external_axes=[ax],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -501,8 +497,8 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(figsize=(11, 5), dpi=150)\n", - "openbb.economy.macro(\n", - " parameters=[\"CONF\", \"IP\"], start_date=\"2010-01-01\", external_axes=[ax], chart=True\n", + "openbb.economy.macro_chart(\n", + " parameters=[\"CONF\", \"IP\"], start_date=\"2010-01-01\", external_axes=[ax]\n", ")\n", "ax.set_title(\"\")\n", "\n", @@ -551,11 +547,10 @@ " )\n", "\n", " ax1 = ax.twinx()\n", - " openbb.economy.fred_series(\n", + " openbb.economy.fred_series_chart(\n", " series_ids=[\"A191RP1A027NBEA\"],\n", " start_date=\"1980-01-01\",\n", " external_axes=[ax1],\n", - " chart=True,\n", " )\n", " ax1.set_ylim([-3, 15])\n", " ax1.set_title(\"\")\n", @@ -694,7 +689,7 @@ "metadata": { "celltoolbar": "Tags", "kernelspec": { - "display_name": "Python 3.10.4 ('obb')", + "display_name": "Python 3.9.12 ('openbb-terminal')", "language": "python", "name": "python3" }, @@ -708,11 +703,11 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.4" + "version": "3.9.12" }, "vscode": { "interpreter": { - "hash": "1a8cc6b6e60740679b24fc1ea93bdeb94d949a22102a80c99b7fd3f0d572afd6" + "hash": "811a8ebb02a69a0058b89c341233bddbf2d95a877272f2a215e4ccb65781d230" } } }, diff --git a/openbb_terminal/reports/templates/equity.ipynb b/openbb_terminal/reports/templates/equity.ipynb index ee4d99244b04..8c8ed3e989ab 100644 --- a/openbb_terminal/reports/templates/equity.ipynb +++ b/openbb_terminal/reports/templates/equity.ipynb @@ -296,13 +296,12 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.stocks.options.pcr(\n", + "openbb.stocks.options.pcr_chart(\n", " symbol,\n", " window=30,\n", " external_axes=[\n", " ax,\n", " ],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -329,13 +328,12 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.stocks.options.vol_yf(\n", + "openbb.stocks.options.vol_yf_chart(\n", " symbol,\n", " exp,\n", " external_axes=[\n", " ax,\n", " ],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -351,13 +349,12 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(figsize=(11, 8), dpi=150)\n", - "openbb.stocks.options.voi_yf(\n", + "openbb.stocks.options.voi_yf_chart(\n", " symbol,\n", " exp,\n", " external_axes=[\n", " ax,\n", " ],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -388,13 +385,12 @@ "source": [ "fig, ax1 = plt.subplots(figsize=(11, 5), dpi=150)\n", "ax2 = ax1.twinx()\n", - "openbb.stocks.dps.spos(\n", + "openbb.stocks.dps.spos_chart(\n", " symbol=symbol,\n", " limit=84,\n", " raw=False,\n", " export=\"\",\n", " external_axes=[ax1, ax2],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "\n", @@ -411,7 +407,7 @@ "outputs": [], "source": [ "fig, (ax1, ax2) = plt.subplots(nrows=2, ncols=1, figsize=(11, 5), dpi=150)\n", - "openbb.stocks.dps.dpotc(symbol=symbol, external_axes=[ax1, ax2], chart=True)\n", + "openbb.stocks.dps.dpotc_chart(symbol=symbol, external_axes=[ax1, ax2])\n", "fig.tight_layout()\n", "\n", "f = io.BytesIO()\n", @@ -427,13 +423,12 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.stocks.gov.gtrades(\n", + "openbb.stocks.gov.gtrades_chart(\n", " symbol,\n", " past_transactions_months=12,\n", " external_axes=[\n", " ax,\n", " ],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -449,13 +444,12 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.stocks.gov.contracts(\n", + "openbb.stocks.gov.contracts_chart(\n", " symbol,\n", " past_transaction_days=365,\n", " external_axes=[\n", " ax,\n", " ],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -471,12 +465,11 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.stocks.ba.mentions(\n", + "openbb.stocks.ba.mentions_chart(\n", " symbol,\n", " external_axes=[\n", " ax,\n", " ],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -492,13 +485,12 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.stocks.ba.regions(\n", + "openbb.stocks.ba.regions_chart(\n", " symbol,\n", " limit=10,\n", " external_axes=[\n", " ax,\n", " ],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -525,13 +517,12 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.stocks.ca.hist(\n", + "openbb.stocks.ca.hist_chart(\n", " similar_companies,\n", " external_axes=[\n", " ax,\n", " ],\n", " normalize=False,\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -547,12 +538,11 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.stocks.ca.hcorr(\n", + "openbb.stocks.ca.hcorr_chart(\n", " similar_companies,\n", " external_axes=[\n", " ax,\n", " ],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -568,12 +558,11 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.stocks.ca.volume(\n", + "openbb.stocks.ca.volume_chart(\n", " similar_companies,\n", " external_axes=[\n", " ax,\n", " ],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -589,12 +578,11 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.stocks.ca.scorr(\n", + "openbb.stocks.ca.scorr_chart(\n", " similar_companies,\n", " external_axes=[\n", " ax,\n", " ],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -651,12 +639,11 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.stocks.gov.histcont(\n", + "openbb.stocks.gov.histcont_chart(\n", " symbol,\n", " external_axes=[\n", " ax,\n", " ],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -684,10 +671,9 @@ "source": [ "fig, (ax1, ax2) = plt.subplots(nrows=2, ncols=1, figsize=(11, 5), dpi=150)\n", "ax3 = ax1.twinx()\n", - "openbb.stocks.dps.psi_sg(\n", + "openbb.stocks.dps.psi_sg_chart(\n", " symbol=symbol,\n", " external_axes=[ax1, ax2, ax3],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "\n", @@ -709,7 +695,6 @@ " data=ticker_data,\n", " use_matplotlib=True,\n", " external_axes=[candles, volume],\n", - " chart=True,\n", ")\n", "candles.set_xticklabels(\"\")\n", "fig.tight_layout()\n", @@ -727,14 +712,13 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.stocks.dd.pt(\n", + "openbb.stocks.dd.pt_chart(\n", " symbol=symbol,\n", " start_date=\"2022-01-01\",\n", " data=ticker_data,\n", " limit=10,\n", " raw=False,\n", " external_axes=[ax],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -777,8 +761,12 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.stocks.dd.rot(\n", - " symbol=symbol, limit=10, raw=False, export=\"\", external_axes=[ax], chart=True\n", + "openbb.stocks.dd.rot_chart(\n", + " symbol=symbol,\n", + " limit=10,\n", + " raw=False,\n", + " export=\"\",\n", + " external_axes=[ax],\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -794,7 +782,7 @@ "outputs": [], "source": [ "fig, (ax1, ax2) = plt.subplots(nrows=2, ncols=1, figsize=(11, 3), dpi=150)\n", - "openbb.ta.rsi(ticker_data[\"Close\"], external_axes=[ax1, ax2], chart=True)\n", + "openbb.ta.rsi_chart(ticker_data[\"Close\"], external_axes=[ax1, ax2])\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", "fig.savefig(f, format=\"svg\")\n", @@ -859,7 +847,7 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.stocks.ba.headlines(symbol=symbol, external_axes=[ax], chart=True)\n", + "openbb.stocks.ba.headlines_chart(symbol=symbol, external_axes=[ax])\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", "fig.savefig(f, format=\"svg\")\n", @@ -908,7 +896,7 @@ "outputs": [], "source": [ "fig, (ax1, ax2) = plt.subplots(nrows=2, ncols=1, figsize=(11, 5), dpi=150)\n", - "openbb.stocks.ba.snews(symbol, external_axes=[ax1, ax2], chart=True)\n", + "openbb.stocks.ba.snews_chart(symbol, external_axes=[ax1, ax2])\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", "fig.savefig(f, format=\"svg\")\n", @@ -937,13 +925,12 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.qa.bw(\n", + "openbb.qa.bw_chart(\n", " ticker_data_all,\n", " \"Returns\",\n", " symbol,\n", " yearly=False,\n", " external_axes=[ax],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -959,8 +946,12 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.ta.bw(\n", - " ticker_data_all, \"Returns\", symbol, yearly=True, external_axes=[ax], chart=True\n", + "openbb.ta.bw_chart(\n", + " ticker_data_all,\n", + " \"Returns\",\n", + " symbol,\n", + " yearly=True,\n", + " external_axes=[ax],\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -1096,7 +1087,7 @@ "outputs": [], "source": [ "fig, (ax, ax1) = plt.subplots(nrows=2, ncols=1, figsize=(11, 5), sharex=True, dpi=150)\n", - "openbb.ta.macd(ticker_data[\"Close\"], symbol=symbol, external_axes=[ax, ax1], chart=True)\n", + "openbb.ta.macd_chart(ticker_data[\"Close\"], symbol=symbol, external_axes=[ax, ax1])\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", "fig.savefig(f, format=\"svg\")\n", @@ -1111,7 +1102,7 @@ "outputs": [], "source": [ "fig, (ax, ax1) = plt.subplots(nrows=2, ncols=1, figsize=(11, 5), sharex=True, dpi=150)\n", - "openbb.ta.cci(ticker_data, symbol=symbol, external_axes=[ax, ax1], chart=True)\n", + "openbb.ta.cci_chart(ticker_data, symbol=symbol, external_axes=[ax, ax1])\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", "fig.savefig(f, format=\"svg\")\n", @@ -1127,7 +1118,7 @@ "source": [ "fig, (ax, ax1) = plt.subplots(nrows=2, ncols=1, figsize=(11, 5), dpi=150)\n", "ax2 = ax1.twinx()\n", - "openbb.ta.stoch(ticker_data, symbol=symbol, external_axes=[ax, ax1, ax2], chart=True)\n", + "openbb.ta.stoch_chart(ticker_data, symbol=symbol, external_axes=[ax, ax1, ax2])\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", "fig.savefig(f, format=\"svg\")\n", @@ -1142,7 +1133,7 @@ "outputs": [], "source": [ "fig, (ax, ax1) = plt.subplots(2, 1, sharex=True, figsize=(11, 5), dpi=150)\n", - "openbb.ta.adx(ticker_data, symbol=symbol, external_axes=[ax, ax1], chart=True)\n", + "openbb.ta.adx_chart(ticker_data, symbol=symbol, external_axes=[ax, ax1])\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", "fig.savefig(f, format=\"svg\")\n", @@ -1157,7 +1148,7 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.ta.bbands(ticker_data, symbol=symbol, external_axes=[ax], chart=True)\n", + "openbb.ta.bbands_chart(ticker_data, symbol=symbol, external_axes=[ax])\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", "fig.savefig(f, format=\"svg\")\n", @@ -1172,7 +1163,7 @@ "outputs": [], "source": [ "fig, (ax, ax1, ax2) = plt.subplots(3, 1, sharex=True, figsize=(11, 8), dpi=150)\n", - "openbb.ta.ad(ticker_data, symbol=symbol, external_axes=[ax, ax1, ax2], chart=True)\n", + "openbb.ta.ad_chart(ticker_data, symbol=symbol, external_axes=[ax, ax1, ax2])\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", "fig.savefig(f, format=\"svg\")\n", @@ -1540,7 +1531,7 @@ "metadata": { "celltoolbar": "Tags", "kernelspec": { - "display_name": "Python 3.10.4 ('obb')", + "display_name": "Python 3.9.12 ('openbb-terminal')", "language": "python", "name": "python3" }, @@ -1554,11 +1545,11 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.4" + "version": "3.9.12" }, "vscode": { "interpreter": { - "hash": "1a8cc6b6e60740679b24fc1ea93bdeb94d949a22102a80c99b7fd3f0d572afd6" + "hash": "811a8ebb02a69a0058b89c341233bddbf2d95a877272f2a215e4ccb65781d230" } } }, diff --git a/openbb_terminal/reports/templates/etf.ipynb b/openbb_terminal/reports/templates/etf.ipynb index c3b50f03aac3..65b78227b100 100644 --- a/openbb_terminal/reports/templates/etf.ipynb +++ b/openbb_terminal/reports/templates/etf.ipynb @@ -163,12 +163,11 @@ "data = openbb.stocks.load(ticker)\n", "\n", "fig, (candles, volume) = plt.subplots(nrows=2, ncols=1, figsize=(11, 5), dpi=150)\n", - "openbb.etf.candle(\n", + "openbb.etf.candle_chart(\n", " symbol=ticker,\n", " data=data,\n", " use_matplotlib=True,\n", " external_axes=[candles, volume],\n", - " chart=True,\n", ")\n", "\n", "candles.set_xticklabels(\"\")\n", @@ -201,7 +200,7 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(dpi=150)\n", - "openbb.etf.weights(ticker, chart=True, external_axes=[ax])\n", + "openbb.etf.weights_chart(ticker, external_axes=[ax])\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", "fig.savefig(f, format=\"svg\")\n", diff --git a/openbb_terminal/reports/templates/forex.ipynb b/openbb_terminal/reports/templates/forex.ipynb index ab7c081de2b9..1b9414bb2629 100644 --- a/openbb_terminal/reports/templates/forex.ipynb +++ b/openbb_terminal/reports/templates/forex.ipynb @@ -162,12 +162,11 @@ "source": [ "# candle\n", "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.forex.candle(\n", + "openbb.forex.candle_chart(\n", " data=ticker_data,\n", " to_symbol=to_symbol,\n", " from_symbol=from_symbol,\n", " external_axes=[ax],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -190,7 +189,6 @@ " from_symbol=from_symbol,\n", " ma=[7, 14],\n", " external_axes=[ax],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -204,7 +202,6 @@ " from_symbol=from_symbol,\n", " ma=[30, 60],\n", " external_axes=[ax],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -255,12 +252,11 @@ "ticker_data.index.names = [\"date\"]\n", "\n", "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.ta.ma(\n", + "openbb.ta.ma_chart(\n", " data=ticker_data[\"Close\"],\n", " ma_type=\"SMA\",\n", " symbol=ticker,\n", " external_axes=[ax],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -277,12 +273,11 @@ "source": [ "# exponential moving average\n", "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.ta.ma(\n", + "openbb.ta.ma_chart(\n", " data=ticker_data[\"Close\"],\n", " ma_type=\"EMA\",\n", " symbol=ticker,\n", " external_axes=[ax],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -300,12 +295,11 @@ "# zero lag exponential moving average\n", "\n", "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.ta.ma(\n", + "openbb.ta.ma_chart(\n", " data=ticker_data[\"Close\"],\n", " ma_type=\"ZLMA\",\n", " symbol=ticker,\n", " external_axes=[ax],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -323,11 +317,10 @@ "# commodity channel index\n", "\n", "fig, (ax1, ax2) = plt.subplots(nrows=2, ncols=1, figsize=(11, 5), dpi=150)\n", - "openbb.ta.cci(\n", + "openbb.ta.cci_chart(\n", " data=ticker_data,\n", " symbol=ticker,\n", " external_axes=[ax1, ax2],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -345,11 +338,10 @@ "# moving average convergence/divergence\n", "\n", "fig, (ax1, ax2) = plt.subplots(nrows=2, ncols=1, figsize=(11, 5), dpi=150)\n", - "openbb.ta.macd(\n", + "openbb.ta.macd_chart(\n", " data=ticker_data[\"Adj Close\"],\n", " symbol=ticker,\n", " external_axes=[ax1, ax2],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -368,11 +360,10 @@ "\n", "fig, (ax1, ax2) = plt.subplots(nrows=2, ncols=1, figsize=(11, 11), dpi=150)\n", "ax3 = ax2.twinx()\n", - "openbb.ta.fisher(\n", + "openbb.ta.fisher_chart(\n", " data=ticker_data,\n", " symbol=ticker,\n", " external_axes=[ax1, ax2, ax3],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -390,11 +381,10 @@ "# aroon indicator\n", "\n", "fig, (ax1, ax2, ax3) = plt.subplots(nrows=3, ncols=1, figsize=(11, 11), dpi=150)\n", - "openbb.ta.aroon(\n", + "openbb.ta.aroon_chart(\n", " data=ticker_data,\n", " symbol=ticker,\n", " external_axes=[ax1, ax2, ax3],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -412,11 +402,10 @@ "# bollinger bands\n", "\n", "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.ta.bbands(\n", + "openbb.ta.bbands_chart(\n", " data=ticker_data,\n", " symbol=ticker,\n", " external_axes=[ax],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -435,11 +424,10 @@ "\n", "fig, ax1 = plt.subplots(figsize=(11, 5), dpi=150)\n", "ax2 = ax1.twinx()\n", - "openbb.ta.fib(\n", + "openbb.ta.fib_chart(\n", " data=ticker_data,\n", " symbol=ticker,\n", " external_axes=[ax1, ax2],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -478,10 +466,9 @@ "# normality statistics and tests\n", "\n", "# fig, _ = plt.subplots(figsize=(11, 3), dpi=150)\n", - "# openbb.qa.normality(\n", + "# openbb.qa.normality_chart(\n", "# data=ticker_data,\n", "# target=\"Close\",\n", - "# chart=True,\n", "# )\n", "# fig.tight_layout()\n", "# f = io.BytesIO()\n", @@ -503,13 +490,12 @@ "# box and whisker plot\n", "\n", "fig, ax = plt.subplots(figsize=(11, 3), dpi=150)\n", - "openbb.qa.bw(\n", + "openbb.qa.bw_chart(\n", " symbol=ticker,\n", " data=ticker_data,\n", " target=\"Close\",\n", " yearly=False,\n", " external_axes=[ax],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -527,12 +513,11 @@ "# rolling mean and std deviation of prices\n", "\n", "fig, (ax1, ax2) = plt.subplots(nrows=2, ncols=1, figsize=(11, 5), dpi=150)\n", - "openbb.qa.rolling(\n", + "openbb.qa.rolling_chart(\n", " symbol=ticker,\n", " data=ticker_data,\n", " target=\"Close\",\n", " external_axes=[ax1, ax2],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -550,12 +535,11 @@ "# rolling kurtosis of distribution of prices\n", "\n", "fig, (ax1, ax2) = plt.subplots(nrows=2, ncols=1, figsize=(11, 5), dpi=150)\n", - "openbb.qa.kurtosis(\n", + "openbb.qa.kurtosis_chart(\n", " symbol=ticker,\n", " data=ticker_data,\n", " target=\"Close\",\n", " external_axes=[ax1, ax2],\n", - " chart=True,\n", ")\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -768,7 +752,7 @@ "metadata": { "celltoolbar": "Tags", "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3.9.12 ('openbb-terminal')", "language": "python", "name": "python3" }, @@ -782,11 +766,11 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.6" + "version": "3.9.12" }, "vscode": { "interpreter": { - "hash": "e784374cc4f9a84ed6af2983247aaf351b155c82bcc2188134a65f3c99031000" + "hash": "811a8ebb02a69a0058b89c341233bddbf2d95a877272f2a215e4ccb65781d230" } } }, diff --git a/openbb_terminal/reports/templates/portfolio.ipynb b/openbb_terminal/reports/templates/portfolio.ipynb index cfaec2a224dc..463bb1b15494 100644 --- a/openbb_terminal/reports/templates/portfolio.ipynb +++ b/openbb_terminal/reports/templates/portfolio.ipynb @@ -153,7 +153,7 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(figsize=(11, 5), dpi=150)\n", - "openbb.portfolio.rbeta(P, chart=True, external_axes=[ax])\n", + "openbb.portfolio.rbeta_chart(P, external_axes=[ax])\n", "\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -169,7 +169,7 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(figsize=(11, 5), dpi=150)\n", - "openbb.portfolio.rsharpe(P, chart=True, external_axes=[ax])\n", + "openbb.portfolio.rsharpe_chart(P, external_axes=[ax])\n", "\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -185,7 +185,7 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(figsize=(11, 5), dpi=150)\n", - "openbb.portfolio.rvol(P, chart=True, external_axes=[ax])\n", + "openbb.portfolio.rvol_chart(P, external_axes=[ax])\n", "\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -201,7 +201,7 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(figsize=(11, 5), dpi=150)\n", - "openbb.portfolio.rsort(P, chart=True, external_axes=[ax])\n", + "openbb.portfolio.rsort_chart(P, external_axes=[ax])\n", "\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -217,7 +217,7 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(nrows=2, ncols=1, figsize=(11, 5), dpi=150)\n", - "openbb.portfolio.maxdd(P, chart=True, external_axes=ax)\n", + "openbb.portfolio.maxdd_chart(P, external_axes=ax)\n", "\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -277,7 +277,7 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(figsize=(10, 4), dpi=150)\n", - "openbb.portfolio.distr(P, chart=True, external_axes=[ax])\n", + "openbb.portfolio.distr_chart(P, external_axes=[ax])\n", "\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -293,7 +293,7 @@ "outputs": [], "source": [ "fig, (ax1, ax2) = plt.subplots(nrows=2, ncols=1, figsize=(10, 4), dpi=150)\n", - "openbb.portfolio.dret(P, chart=True, external_axes=[ax1, ax2])\n", + "openbb.portfolio.dret_chart(P, external_axes=[ax1, ax2])\n", "\n", "fig.tight_layout()\n", "f = io.BytesIO()\n", @@ -309,7 +309,7 @@ "outputs": [], "source": [ "fig, ax = plt.subplots(figsize=(10, 4), dpi=150)\n", - "openbb.portfolio.yret(P, chart=True, external_axes=[ax])\n", + "openbb.portfolio.yret_chart(P, external_axes=[ax])\n", "\n", "fig.tight_layout()\n", "f = io.BytesIO()\n",