Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] ReferenceGenerator class in package_builder.py #6179

Merged
merged 31 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9b82d26
fix docstrings in quantitative,technical,econometrics routers
the-praxs Mar 10, 2024
740d5a2
add reference generator class to create reference.json file in openbb…
the-praxs Mar 10, 2024
3f21e95
modify platform markdown generator script to not generate the referen…
the-praxs Mar 10, 2024
3c5b11c
get properly formatted examples for the website
the-praxs Mar 10, 2024
9ceab6f
modify get_field_type function
the-praxs Mar 10, 2024
23b7cbe
remove TODO comment
the-praxs Mar 11, 2024
5ef9948
path change / to .
the-praxs Mar 11, 2024
2f4fc20
remove extra '-' below 'Args' in function docstring
the-praxs Mar 11, 2024
ace7157
get obbject extensions in extension_map.json
the-praxs Mar 11, 2024
95b0eef
Merge branch 'develop' into feature/reference-generator-package-builder
the-praxs Mar 11, 2024
02e64a4
skew in stats_router had extra . rip
the-praxs Mar 11, 2024
cf16c43
black
the-praxs Mar 11, 2024
0f40a48
extra space (sigh)
the-praxs Mar 11, 2024
4a65fad
Merge branch 'develop' into feature/reference-generator-package-builder
the-praxs Mar 11, 2024
58ef39e
Merge branch 'develop' into feature/reference-generator-package-builder
the-praxs Mar 11, 2024
aab45cf
Merge branch 'develop' into feature/reference-generator-package-builder
the-praxs Mar 11, 2024
ae1e166
modify get_provider_parameter_info func to use model_provider from pr…
the-praxs Mar 11, 2024
13e7d8b
update lock files
the-praxs Mar 11, 2024
53be33d
black
the-praxs Mar 12, 2024
cb782ba
Revert "update lock files"
the-praxs Mar 12, 2024
5a8500a
Merge branch 'develop' into feature/reference-generator-package-builder
the-praxs Mar 12, 2024
022a622
add function to check all extensions are installed before the markdow…
the-praxs Mar 12, 2024
27bad78
better comment
the-praxs Mar 12, 2024
f6401b2
Merge branch 'develop' into feature/reference-generator-package-builder
the-praxs Mar 12, 2024
f66607a
Merge branch 'develop' into feature/reference-generator-package-builder
the-praxs Mar 12, 2024
2ad5516
fix docstring
the-praxs Mar 12, 2024
5d7baa0
black
the-praxs Mar 12, 2024
c420876
'static
the-praxs Mar 13, 2024
4211227
remove duplicate standard params & data from reference data
the-praxs Mar 13, 2024
0090c60
Merge branch 'develop' into feature/reference-generator-package-builder
the-praxs Mar 13, 2024
5891c58
Merge branch 'develop' into feature/reference-generator-package-builder
the-praxs Mar 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
474 changes: 440 additions & 34 deletions openbb_platform/core/openbb_core/app/static/package_builder.py

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions openbb_platform/core/tests/app/static/test_package_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ def test_package_builder_build(package_builder):
package_builder.build()


def test_save_module_map(package_builder):
"""Test save module map."""
package_builder._save_module_map()


def test_save_modules(package_builder):
"""Test save module."""
package_builder._save_modules()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def correlation_matrix(data: List[Data]) -> OBBject[List[Data]]:

Returns
-------
OBBject[List[Data]]:
OBBject[List[Data]]
Correlation matrix.
"""
df = basemodel_to_df(data)
Expand Down Expand Up @@ -120,7 +120,7 @@ def ols_regression(

Returns
-------
OBBject[Dict]:
OBBject[Dict]
OBBject with the results being model and results objects.
"""
X = sm.add_constant(get_target_columns(basemodel_to_df(data), x_columns))
Expand Down Expand Up @@ -169,7 +169,7 @@ def ols_regression_summary(

Returns
-------
OBBject[Data]:
OBBject[Data]
OBBject with the results being summary object.
"""
X = sm.add_constant(get_target_columns(basemodel_to_df(data), x_columns))
Expand Down Expand Up @@ -260,7 +260,7 @@ def autocorrelation(

Returns
-------
OBBject[Dict]:
OBBject[Dict]
OBBject with the results being the score from the test.
"""
X = sm.add_constant(get_target_columns(basemodel_to_df(data), x_columns))
Expand Down Expand Up @@ -317,7 +317,7 @@ def residual_autocorrelation(

Returns
-------
OBBject[Data]:
OBBject[Data]
OBBject with the results being the score from the test.
"""
X = sm.add_constant(get_target_columns(basemodel_to_df(data), x_columns))
Expand Down Expand Up @@ -374,7 +374,7 @@ def cointegration(

Returns
-------
OBBject[Data]:
OBBject[Data]
OBBject with the results being the score from the test.
"""
pairs = list(combinations(columns, 2))
Expand Down Expand Up @@ -450,7 +450,7 @@ def causality(

Returns
-------
OBBject[Data]:
OBBject[Data]
OBBject with the results being the score from the test.
"""
X = get_target_column(basemodel_to_df(data), x_column)
Expand Down Expand Up @@ -518,7 +518,7 @@ def unit_root(

Returns
-------
OBBject[Data]:
OBBject[Data]
OBBject with the results being the score from the test.
"""
dataset = get_target_column(basemodel_to_df(data), column)
Expand Down Expand Up @@ -568,7 +568,7 @@ def panel_random_effects(

Returns
-------
OBBject[Dict]:
OBBject[Dict]
OBBject with the fit model returned
"""
X = get_target_columns(basemodel_to_df(data), x_columns)
Expand Down Expand Up @@ -615,7 +615,7 @@ def panel_between(

Returns
-------
OBBject[Dict]:
OBBject[Dict]
OBBject with the fit model returned
"""
X = get_target_columns(basemodel_to_df(data), x_columns)
Expand Down Expand Up @@ -661,7 +661,7 @@ def panel_pooled(

Returns
-------
OBBject[Dict]:
OBBject[Dict]
OBBject with the fit model returned
"""
X = get_target_columns(basemodel_to_df(data), x_columns)
Expand Down Expand Up @@ -706,7 +706,7 @@ def panel_fixed(

Returns
-------
OBBject[Dict]:
OBBject[Dict]
OBBject with the fit model returned
"""
X = get_target_columns(basemodel_to_df(data), x_columns)
Expand Down Expand Up @@ -751,7 +751,7 @@ def panel_first_difference(

Returns
-------
OBBject[Dict]:
OBBject[Dict]
OBBject with the fit model returned
"""
X = get_target_columns(basemodel_to_df(data), x_columns)
Expand Down Expand Up @@ -797,7 +797,7 @@ def panel_fmac(

Returns
-------
OBBject[Dict]:
OBBject[Dict]
OBBject with the fit model returned
"""
X = get_target_columns(basemodel_to_df(data), x_columns)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ def skew(
Rolling skew.

"""

df = basemodel_to_df(data, index=index)
series_target = get_target_column(df, target)
series_target.name = f"rolling_skew_{window}"
Expand Down Expand Up @@ -132,7 +131,7 @@ def variance(
index: str, optional
The name of the index column, default is "date".

Returns:
Returns
-------
OBBject[List[Data]]
An object containing the rolling variance values.
Expand Down Expand Up @@ -177,8 +176,8 @@ def stdev(
Calculate the rolling standard deviation of a target column within a given window size.

Standard deviation is a measure of the amount of variation or dispersion of a set of values.
It is widely used to assess the risk and volatility of financial returns or other time series data
over a specified rolling window. It is the square root of the variance.
It is widely used to assess the risk and volatility of financial returns or other time series data
over a specified rolling window. It is the square root of the variance.

Parameters
----------
Expand All @@ -191,12 +190,11 @@ def stdev(
index: str, optional
The name of the index column, default is "date".

Returns:
Returns
-------
OBBject[List[Data]]
An object containing the rolling standard deviation values.
"""

df = basemodel_to_df(data, index=index)
series_target = get_target_column(df, target)
series_target.name = f"rolling_stdev_{window}"
Expand Down Expand Up @@ -255,12 +253,11 @@ def kurtosis(
index: str, optional
The name of the index column, default is "date".

Returns:
Returns
-------
OBBject[List[Data]]
An object containing the rolling kurtosis values.
"""

df = basemodel_to_df(data, index=index)
series_target = get_target_column(df, target)
series_target.name = f"rolling_kurtosis_{window}"
Expand Down Expand Up @@ -324,12 +321,11 @@ def quantile(
index: str, optional
The name of the index column, default is "date".

Returns:
Returns
-------
OBBject[List[Data]]
An object containing the rolling quantile values with the median.
"""

df = basemodel_to_df(data, index=index)
series_target = get_target_column(df, target)
validate_window(series_target, window)
Expand Down Expand Up @@ -398,11 +394,11 @@ def mean(
index: str, optional
The name of the index column, default is "date".

Returns:
OBBject[List[Data]]
An object containing the rolling mean values.
Returns
-------
OBBject[List[Data]]
An object containing the rolling mean values.
"""

df = basemodel_to_df(data, index=index)
series_target = get_target_column(df, target)
series_target.name = f"rolling_mean_{window}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def skew(
data: List[Data],
target: str,
) -> OBBject[List[Data]]:
"""Get the skew. of the data set
"""Get the skew of the data set.

Skew is a statistical measure that reveals the degree of asymmetry of a distribution around its mean.
Positive skewness indicates a distribution with an extended tail to the right, while negative skewness shows a tail
Expand All @@ -70,7 +70,6 @@ def skew(
OBBject[List[Data]]
Rolling skew.
"""

df = basemodel_to_df(data)
series_target = get_target_column(df, target)
results = pd.DataFrame([skew_(series_target)], columns=["skew"])
Expand Down Expand Up @@ -170,7 +169,6 @@ def stdev(data: List[Data], target: str) -> OBBject[List[Data]]:
OBBject[List[Data]]
An object containing the rolling standard deviation values.
"""

df = basemodel_to_df(data)
series_target = get_target_column(df, target)
results = pd.DataFrame([std_dev_(series_target)], columns=["stdev"])
Expand Down Expand Up @@ -218,11 +216,10 @@ def kurtosis(data: List[Data], target: str) -> OBBject[List[Data]]:
The name of the column for which to calculate kurtosis.

Returns
------
-------
OBBject[List[Data]]
An object containing the kurtosis value
"""

df = basemodel_to_df(data)
series_target = get_target_column(df, target)
results = pd.DataFrame([kurtosis_(series_target)], columns=["kurtosis"])
Expand Down Expand Up @@ -278,7 +275,6 @@ def quantile(
OBBject[List[Data]]
An object containing the rolling quantile values with the median.
"""

df = basemodel_to_df(
data,
)
Expand Down Expand Up @@ -335,7 +331,6 @@ def mean(
OBBject[List[Data]]
An object containing the mean value.
"""

df = basemodel_to_df(data)
series_target = get_target_column(df, target)
results = pd.DataFrame([mean_(series_target)], columns=["mean"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ def adosc(
Returns
-------
OBBject[List[Data]]
The calculated data.
"""
validate_data(data, [fast, slow])
df = basemodel_to_df(data, index=index)
Expand Down Expand Up @@ -1093,6 +1094,7 @@ def ad(data: List[Data], index: str = "date", offset: int = 0) -> OBBject[List[D
Returns
-------
OBBject[List[Data]]
The calculated data.
"""
df = basemodel_to_df(data, index=index)
df_target = get_target_columns(df, ["high", "low", "close", "volume"])
Expand Down
1 change: 1 addition & 0 deletions openbb_platform/openbb/assets/extension_map.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"[email protected]",
"[email protected]"
],
"openbb_obbject_extension": [],
"openbb_provider_extension": [
"[email protected]",
"[email protected]",
Expand Down
Loading
Loading