summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrique Joaquim <h.joaquim@campus.fct.unl.pt>2024-02-14 15:19:27 +0000
committerGitHub <noreply@github.com>2024-02-14 15:19:27 +0000
commit2f01e954d149bbc8f6f5611a22dbae17c2ca8ae3 (patch)
treef2cd5575b514d2fa767b11b642abbb70a52d74fd
parentcb192cbdd0af469e1247ac914591e8fd5d3e2f7d (diff)
Feature/charting obbject (#5938)
* fix circular import issues on the obbject extension framework * settings available on the obbject * extension init * charting assets and code * introduce to_chart functionality * removes the to_chart method from obbject in detriment of the one from the obbject extension * Update openbb_platform/obbject_extensions/charting/charting/__init__.py Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> * fix on the show method * adding the example to the to_chart docstring * copying the exsting README from charting extension - needs to be revamped * moving to openbb_charting instead * update the pyproject.toml file * pydocstyle * versions * better docstrings * making accessors public * removing unnecessary credentials variable cc @montezdesousa * removing access to extra/metadata and use designated private attrs instead * Fixes linting for the logging service (#5992) * lints * typing.Type instead * deprecating ChartingService to use the new extension instead - adding function discovery capabilities using it * tests for the obbject charting extension * removing charting service from command runner * filter functions not implemented in the module * remove charting service tests * removing charting service on the tests for int tests * charting integration tests * removing charting service file * removing old charting extension code * revamp builder * fix obbject tests * fix command_runner tests * removing openbb_figure_table * better website docs * reviewed readme * unsetting api key for posthog (pywry) windows * added debug_mode to the system settings * removing api key * update nightly script * fix tests * black * black * Revert "black" This reverts commit 21d76ad689087b4ad38cec55667186263363c89f. * Revert "black" This reverts commit 0904653fd73518c0d345a82f91f4cb06cfa84cb6. * black for henrique * returning a list instead * better docstrings * removing unnecessary indicators docstring * typo * black * intentional access to protected member * changes to publish script * filtering deleted files * black * adding render argument * fixing the df_to_basemodel function: it should include the index in the columns either if flagged or if the index is named * adding the hability to add you own data to to_chart method * tests * black * disable protected access * accept kwargs to eg. save image * adjustment cc Igor * add if statement for protection * remove unused return typing * fix technical charting views * better error message cc @IgorWounds * better structure and fix test * Revert "better structure and fix test" This reverts commit 612ea6117ce064d5e41f74e72e171646be614408. * Revert "better error message cc @IgorWounds" This reverts commit 3d7ee53878b7742d187e83f7e5d4c27438aa40ef. --------- Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Co-authored-by: James Maslek <jmaslek11@gmail.com>
-rw-r--r--.github/workflows/linting.yml2
-rw-r--r--build/pypi/openbb_platform/nightly.py3
-rw-r--r--build/pypi/openbb_platform/publish.py2
-rw-r--r--openbb_platform/core/openbb_core/api/router/commands.py16
-rw-r--r--openbb_platform/core/openbb_core/app/charting_service.py287
-rw-r--r--openbb_platform/core/openbb_core/app/command_runner.py29
-rw-r--r--openbb_platform/core/openbb_core/app/logs/logging_service.py18
-rw-r--r--openbb_platform/core/openbb_core/app/model/charts/charting_settings.py7
-rw-r--r--openbb_platform/core/openbb_core/app/model/extension.py2
-rw-r--r--openbb_platform/core/openbb_core/app/model/obbject.py62
-rw-r--r--openbb_platform/core/openbb_core/app/model/system_settings.py3
-rw-r--r--openbb_platform/core/openbb_core/app/service/system_service.py7
-rw-r--r--openbb_platform/core/openbb_core/app/static/container.py3
-rw-r--r--openbb_platform/core/openbb_core/app/static/package_builder.py18
-rw-r--r--openbb_platform/core/openbb_core/app/utils.py10
-rw-r--r--openbb_platform/core/tests/app/model/test_obbject.py43
-rw-r--r--openbb_platform/core/tests/app/model/test_system_settings.py4
-rw-r--r--openbb_platform/core/tests/app/test_charting_service.py384
-rw-r--r--openbb_platform/core/tests/app/test_command_runner.py31
-rw-r--r--openbb_platform/dev_install.py2
-rw-r--r--openbb_platform/extensions/charting/integration/.gitkeep0
-rw-r--r--openbb_platform/extensions/charting/openbb_charting/__init__.py6
-rw-r--r--openbb_platform/extensions/charting/openbb_charting/core/openbb_figure_table.py95
-rw-r--r--openbb_platform/extensions/charting/openbb_charting/py.typed0
-rw-r--r--openbb_platform/extensions/charting/poetry.lock2196
-rw-r--r--openbb_platform/extensions/charting/tests/.gitkeep0
-rw-r--r--openbb_platform/extensions/tests/test_integration_tests_api.py5
-rw-r--r--openbb_platform/extensions/tests/test_integration_tests_python.py5
-rw-r--r--openbb_platform/extensions/tests/utils/integration_tests_api_generator.py23
-rw-r--r--openbb_platform/extensions/tests/utils/integration_tests_generator.py15
-rw-r--r--openbb_platform/obbject_extensions/charting/README.md (renamed from openbb_platform/extensions/charting/README.md)88
-rw-r--r--openbb_platform/obbject_extensions/charting/integration/test_charting_api.py (renamed from openbb_platform/extensions/charting/integration/test_charting_api.py)0
-rw-r--r--openbb_platform/obbject_extensions/charting/integration/test_charting_python.py (renamed from openbb_platform/extensions/charting/integration/test_charting_python.py)0
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/__init__.py201
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/builder.py (renamed from openbb_platform/extensions/charting/openbb_charting/builder.py)13
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/charting_router.py (renamed from openbb_platform/extensions/charting/openbb_charting/charting_router.py)68
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/core/__init__.py (renamed from openbb_platform/extensions/charting/__init__.py)0
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/core/assets/Terminal_icon.png (renamed from openbb_platform/extensions/charting/openbb_charting/core/assets/Terminal_icon.png)bin418780 -> 418780 bytes
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/core/assets/plotly-2.24.2.min.js (renamed from openbb_platform/extensions/charting/openbb_charting/core/assets/plotly-2.24.2.min.js)0
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/core/backend.py (renamed from openbb_platform/extensions/charting/openbb_charting/core/backend.py)17
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/core/chart_style.py (renamed from openbb_platform/extensions/charting/openbb_charting/core/chart_style.py)1
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/core/config/__init__.py (renamed from openbb_platform/extensions/charting/openbb_charting/core/__init__.py)0
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/core/config/openbb_styles.py (renamed from openbb_platform/extensions/charting/openbb_charting/core/config/openbb_styles.py)0
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/core/dummy_backend.py (renamed from openbb_platform/extensions/charting/openbb_charting/core/dummy_backend.py)0
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/core/openbb_figure.py (renamed from openbb_platform/extensions/charting/openbb_charting/core/openbb_figure.py)55
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/core/plotly.html (renamed from openbb_platform/extensions/charting/openbb_charting/core/plotly.html)6
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/core/plotly_ta/__init__.py (renamed from openbb_platform/extensions/charting/openbb_charting/core/config/__init__.py)0
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/core/plotly_ta/base.py (renamed from openbb_platform/extensions/charting/openbb_charting/core/plotly_ta/base.py)0
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/core/plotly_ta/data_classes.py (renamed from openbb_platform/extensions/charting/openbb_charting/core/plotly_ta/data_classes.py)92
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/core/plotly_ta/plugins/custom_indicators_plugin.py (renamed from openbb_platform/extensions/charting/openbb_charting/core/plotly_ta/plugins/custom_indicators_plugin.py)0
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/core/plotly_ta/plugins/momentum_plugin.py (renamed from openbb_platform/extensions/charting/openbb_charting/core/plotly_ta/plugins/momentum_plugin.py)0
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/core/plotly_ta/plugins/overlap_plugin.py (renamed from openbb_platform/extensions/charting/openbb_charting/core/plotly_ta/plugins/overlap_plugin.py)0
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/core/plotly_ta/plugins/trend_indicators_plugin.py (renamed from openbb_platform/extensions/charting/openbb_charting/core/plotly_ta/plugins/trend_indicators_plugin.py)0
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/core/plotly_ta/plugins/volatility_plugin.py (renamed from openbb_platform/extensions/charting/openbb_charting/core/plotly_ta/plugins/volatility_plugin.py)0
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/core/plotly_ta/plugins/volume_plugin.py (renamed from openbb_platform/extensions/charting/openbb_charting/core/plotly_ta/plugins/volume_plugin.py)0
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/core/plotly_ta/ta_class.py (renamed from openbb_platform/extensions/charting/openbb_charting/core/plotly_ta/ta_class.py)37
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/core/plotly_ta/ta_helpers.py (renamed from openbb_platform/extensions/charting/openbb_charting/core/plotly_ta/ta_helpers.py)0
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/core/table.html (renamed from openbb_platform/extensions/charting/openbb_charting/core/table.html)4
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/core/to_chart.py (renamed from openbb_platform/extensions/charting/openbb_charting/core/to_chart.py)11
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/styles/default/dark.pltstyle.json (renamed from openbb_platform/extensions/charting/openbb_charting/styles/default/dark.pltstyle.json)0
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/styles/default/light.pltstyle.json (renamed from openbb_platform/extensions/charting/openbb_charting/styles/default/light.pltstyle.json)0
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/styles/default/tables.pltstyle.json (renamed from openbb_platform/extensions/charting/openbb_charting/styles/default/tables.pltstyle.json)0
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/utils/__init__.py1
-rw-r--r--openbb_platform/obbject_extensions/charting/openbb_charting/utils/helpers.py21
-rw-r--r--openbb_platform/obbject_extensions/charting/poetry.lock1382
-rw-r--r--openbb_platform/obbject_extensions/charting/pyproject.toml (renamed from openbb_platform/extensions/charting/pyproject.toml)8
-rw-r--r--openbb_platform/obbject_extensions/charting/tests/__init__.py (renamed from openbb_platform/extensions/charting/openbb_charting/core/plotly_ta/__init__.py)0
-rw-r--r--openbb_platform/obbject_extensions/charting/tests/test_charting.py131
-rw-r--r--openbb_platform/pyproject.toml2
-rw-r--r--website/content/platform/development/developer-guidelines/obbject.md21
-rw-r--r--website/content/platform/development/developer-guidelines/obbject_extensions.md2
-rw-r--r--website/content/platform/extensions/toolkit_extensions.md18
72 files changed, 2141 insertions, 3316 deletions
diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml
index 253796f5cd3..6e98c849c87 100644
--- a/.github/workflows/linting.yml
+++ b/.github/workflows/linting.yml
@@ -51,7 +51,7 @@ jobs:
# "Checking PR diff"
echo "terminal_files=$(git diff --name-only origin/${{ github.base_ref }}...${{ github.head_ref }} | grep 'openbb_terminal/.*\.py$' | xargs)" >> $GITHUB_ENV
echo $terminal_files
- echo "platform_files=$(git diff --name-only origin/${{ github.base_ref }}...${{ github.head_ref }} | grep 'openbb_platform/.*\.py$' | grep -v 'openbb_platform/openbb/package' | grep -v 'integration' | grep -v 'tests' | xargs)" >> $GITHUB_ENV
+ echo "platform_files=$(git diff --diff-filter=d --name-only origin/${{ github.base_ref }}...${{ github.head_ref }} | grep 'openbb_platform/.*\.py$' | grep -v 'openbb_platform/openbb/package' | grep -v 'integration' | grep -v 'tests' | xargs)" >> $GITHUB_ENV
echo $platform_files
- uses: actions/cache@v3
diff --git a/build/pypi/openbb_platform/nightly.py b/build/pypi/openbb_platform/nightly.py
index fc002f5cb8a..c8e610365bf 100644
--- a/build/pypi/openbb_platform/nightly.py
+++ b/build/pypi/openbb_platform/nightly.py
@@ -13,6 +13,7 @@ DEPENDENCIES: Dict[str, Any] = {}
PLUGINS: Dict[str, Dict] = {
"openbb_core_extension": {},
"openbb_provider_extension": {},
+ "openbb_obbject_extension": {},
}
CMD = [sys.executable, "-m", "poetry", "build"]
@@ -47,7 +48,7 @@ def gather_metadata(sub_path: str):
def build():
"""Build the Platform package."""
- for sub_path in ["core", "providers", "extensions"]:
+ for sub_path in ["core", "providers", "extensions", "obbject_extensions"]:
gather_metadata(sub_path)
# need to pop these from the dependencies
diff --git a/build/pypi/openbb_platform/publish.py b/build/pypi/openbb_platform/publish.py
index 7b1be5e9ae7..bf48478e103 100644
--- a/build/pypi/openbb_platform/publish.py
+++ b/build/pypi/openbb_platform/publish.py
@@ -7,7 +7,7 @@ from pathlib import Path
PLATFORM_PATH = Path(__file__).parent.parent.parent.parent.resolve() / "openbb_platform"
CORE_PACKAGES = ["core"]
-EXTENSION_PACKAGES = ["extensions", "providers"]
+EXTENSION_PACKAGES = ["extensions", "providers", "obbject_extensions"]
CMD = [sys.executable, "-m", "poetry"]