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

[BugFix] - Fix QA Examples #6072

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def normality(data: List[Data], target: str) -> OBBject[NormalityModel]:
Examples
--------
>>> from openbb import obb
>>> stock_data = obb.equity.price.historical(symbol="TSLA", start_date="2023-01-01", provider="fmp")
>>> stock_data = obb.equity.price.historical(symbol="TSLA", start_date="2023-01-01", provider="fmp").to_df()
>>> obb.quantitative.normality(data=stock_data, target="close")
"""
from scipy import stats # pylint: disable=import-outside-toplevel
Expand Down Expand Up @@ -103,7 +103,7 @@ def capm(data: List[Data], target: str) -> OBBject[CAPMModel]:
Examples
--------
>>> from openbb import obb
>>> stock_data = obb.equity.price.historical(symbol="TSLA", start_date="2023-01-01", provider="fmp")
>>> stock_data = obb.equity.price.historical(symbol="TSLA", start_date="2023-01-01", provider="fmp").to_df()
>>> obb.quantitative.capm(data=stock_data, target="close")
"""
import statsmodels.api as sm # pylint: disable=import-outside-toplevel # type: ignore
Expand Down Expand Up @@ -169,7 +169,7 @@ def omega_ratio(
Examples
--------
>>> from openbb import obb
>>> stock_data = obb.equity.price.historical(symbol="TSLA", start_date="2023-01-01", provider="fmp")
>>> stock_data = obb.equity.price.historical(symbol="TSLA", start_date="2023-01-01", provider="fmp").to_df()
>>> obb.quantitative.omega_ratio(data=stock_data, target="close")
"""
df = basemodel_to_df(data)
Expand Down Expand Up @@ -223,7 +223,7 @@ def kurtosis(data: List[Data], target: str, window: PositiveInt) -> OBBject[List
Examples
--------
>>> from openbb import obb
>>> stock_data = obb.equity.price.historical(symbol="TSLA", start_date="2023-01-01", provider="fmp")
>>> stock_data = obb.equity.price.historical(symbol="TSLA", start_date="2023-01-01", provider="fmp").to_df()
>>> obb.quantitative.kurtosis(data=stock_data, target="close", window=252)
"""
import pandas_ta as ta # pylint: disable=import-outside-toplevel # type: ignore
Expand Down Expand Up @@ -272,7 +272,7 @@ def unitroot_test(
Examples
--------
>>> from openbb import obb
>>> stock_data = obb.equity.price.historical(symbol="TSLA", start_date="2023-01-01", provider="fmp")
>>> stock_data = obb.equity.price.historical(symbol="TSLA", start_date="2023-01-01", provider="fmp").to_df()
>>> obb.quantitative.unitroot_test(data=stock_data, target="close")
>>> obb.quantitative.unitroot_test(data=stock_data, target="close", fuller_reg="ct", kpss_reg="ct")
"""
Expand Down Expand Up @@ -334,7 +334,7 @@ def sharpe_ratio(
Examples
--------
>>> from openbb import obb
>>> stock_data = obb.equity.price.historical(symbol="TSLA", start_date="2023-01-01", provider="fmp")
>>> stock_data = obb.equity.price.historical(symbol="TSLA", start_date="2023-01-01", provider="fmp").to_df()
>>> obb.quantitative.sharpe_ratio(data=stock_data, target="close")
>>> obb.quantitative.sharpe_ratio(data=stock_data, target="close", rfr=0.01, window=126)
"""
Expand Down Expand Up @@ -393,7 +393,7 @@ def sortino_ratio(
Examples
--------
>>> from openbb import obb
>>> stock_data = obb.equity.price.historical(symbol="TSLA", start_date="2023-01-01", provider="fmp")
>>> stock_data = obb.equity.price.historical(symbol="TSLA", start_date="2023-01-01", provider="fmp").to_df()
>>> obb.quantitative.sortino_ratio(data=stock_data, target="close")
>>> obb.quantitative.sortino_ratio(data=stock_data, target="close", target_return=0.01, window=126, adjusted=True)
"""
Expand Down Expand Up @@ -441,7 +441,7 @@ def skewness(data: List[Data], target: str, window: PositiveInt) -> OBBject[List
Examples
--------
>>> from openbb import obb
>>> stock_data = obb.equity.price.historical(symbol="TSLA", start_date="2023-01-01", provider="fmp")
>>> stock_data = obb.equity.price.historical(symbol="TSLA", start_date="2023-01-01", provider="fmp").to_df()
>>> obb.quantitative.skewness(data=stock_data, target="close", window=252)
"""
import pandas_ta as ta # pylint: disable=import-outside-toplevel # type: ignore
Expand Down Expand Up @@ -488,7 +488,7 @@ def quantile(
Examples
--------
>>> from openbb import obb
>>> stock_data = obb.equity.price.historical(symbol="TSLA", start_date="2023-01-01", provider="fmp")
>>> stock_data = obb.equity.price.historical(symbol="TSLA", start_date="2023-01-01", provider="fmp").to_df()
>>> obb.quantitative.quantile(data=stock_data, target="close", window=252, quantile_pct=0.25)
>>> obb.quantitative.quantile(data=stock_data, target="close", window=252, quantile_pct=0.75)
"""
Expand Down Expand Up @@ -532,7 +532,7 @@ def summary(data: List[Data], target: str) -> OBBject[SummaryModel]:
Examples
--------
>>> from openbb import obb
>>> stock_data = obb.equity.price.historical(symbol="TSLA", start_date="2023-01-01", provider="fmp")
>>> stock_data = obb.equity.price.historical(symbol="TSLA", start_date="2023-01-01", provider="fmp").to_df()
>>> obb.quantitative.summary(data=stock_data, target="close")
"""
df = basemodel_to_df(data)
Expand Down
Loading