Skip to content

Commit

Permalink
Merge branch 'develop' into bugfix/pywry-plot-paperbg
Browse files Browse the repository at this point in the history
  • Loading branch information
deeleeramone authored May 10, 2024
2 parents 9300f08 + 83476ad commit 6700cce
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 47 deletions.
58 changes: 33 additions & 25 deletions openbb_platform/core/openbb_core/app/command_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,31 +304,38 @@ def _chart(
**kwargs,
) -> None:
"""Create a chart from the command output."""
if "charting" not in obbject.accessors:
raise OpenBBError(
"Charting is not installed. Please install `openbb-charting`."
)
chart_params = {}
extra_params = kwargs.get("extra_params", {})

if hasattr(extra_params, "__dict__") and hasattr(extra_params, "chart_params"):
chart_params = kwargs["extra_params"].__dict__.get("chart_params", {})
elif isinstance(extra_params, dict) and "chart_params" in extra_params:
chart_params = kwargs["extra_params"].get("chart_params", {})

if "chart_params" in kwargs and kwargs["chart_params"] is not None:
chart_params.update(kwargs.pop("chart_params", {}))

if (
"kwargs" in kwargs
and "chart_params" in kwargs["kwargs"]
and kwargs["kwargs"].get("chart_params") is not None
):
chart_params.update(kwargs.pop("kwargs", {}).get("chart_params", {}))

if chart_params:
kwargs.update(chart_params)
obbject.charting.show(render=False, **kwargs)
try:
if "charting" not in obbject.accessors:
raise OpenBBError(
"Charting is not installed. Please install `openbb-charting`."
)
chart_params = {}
extra_params = kwargs.get("extra_params", {})

if hasattr(extra_params, "__dict__") and hasattr(
extra_params, "chart_params"
):
chart_params = kwargs["extra_params"].__dict__.get("chart_params", {})
elif isinstance(extra_params, dict) and "chart_params" in extra_params:
chart_params = kwargs["extra_params"].get("chart_params", {})

if "chart_params" in kwargs and kwargs["chart_params"] is not None:
chart_params.update(kwargs.pop("chart_params", {}))

if (
"kwargs" in kwargs
and "chart_params" in kwargs["kwargs"]
and kwargs["kwargs"].get("chart_params") is not None
):
chart_params.update(kwargs.pop("kwargs", {}).get("chart_params", {}))

if chart_params:
kwargs.update(chart_params)
obbject.charting.show(render=False, **kwargs)
except Exception as e: # pylint: disable=broad-exception-caught
if Env().DEBUG_MODE:
raise OpenBBError(e) from e
warn(str(e), OpenBBWarning)

# pylint: disable=R0913, R0914
@classmethod
Expand Down Expand Up @@ -449,6 +456,7 @@ async def run(
except Exception as e:
if Env().DEBUG_MODE:
raise OpenBBError(e) from e
warn(str(e), OpenBBWarning)

return obbject

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def get_url_params(symbol: str) -> str:
url_params = f"{symbol}?{query_str}&apikey={api_key}"
url = f"{base_url}/historical-chart/{interval}/{url_params}"
if interval == "1day":
url = f"{base_url}/historical-price-full/crypto/{url_params}"
url = f"{base_url}/historical-price-full/{url_params}"
return url

symbols = query.symbol.split(",")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def get_url_params(symbol: str) -> str:
url_params = f"{symbol}?{query_str}&apikey={api_key}"
url = f"{base_url}/historical-chart/{interval}/{url_params}"
if interval == "1day":
url = f"{base_url}/historical-price-full/forex/{url_params}"
url = f"{base_url}/historical-price-full/{url_params}"
return url

symbols = query.symbol.split(",")
Expand All @@ -108,11 +108,8 @@ def get_url_params(symbol: str) -> str:

async def get_one(symbol):
"""Get data for one symbol."""

url = get_url_params(symbol)

data = []

response = await amake_request(url, **kwargs)

if isinstance(response, dict) and response.get("Error Message"):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interactions:
Connection:
- keep-alive
method: GET
uri: https://financialmodelingprep.com/api/v3/historical-price-full/crypto/BTCUSD?apikey=MOCK_API_KEY&from=2023-01-01&interval=1d&to=2023-01-10
uri: https://financialmodelingprep.com/api/v3/historical-price-full/BTCUSD?apikey=MOCK_API_KEY&from=2023-01-01&interval=1d&to=2023-01-10
response:
body:
string: !!binary |
Expand Down Expand Up @@ -48,7 +48,7 @@ interactions:
Content-Type:
- application/json; charset=utf-8
Date:
- Thu, 29 Feb 2024 04:42:50 GMT
- Thu, 09 May 2024 15:33:03 GMT
Etag:
- W/"ee3-iGBRI0WlQUT/ED3Q3GcS73lQbMw"
Server:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,23 @@ interactions:
Connection:
- keep-alive
method: GET
uri: https://financialmodelingprep.com/api/v3/historical-price-full/forex/EURUSD?apikey=MOCK_API_KEY&from=2023-01-01&interval=1d&to=2023-01-10
uri: https://financialmodelingprep.com/api/v3/historical-price-full/EURUSD?apikey=MOCK_API_KEY&from=2023-01-01&interval=1d&to=2023-01-10
response:
body:
string: !!binary |
H4sIAAAAAAAAA5WWPW/bMBCG9/wKwbNt3PFbWdsuXVq0TZeig2ILsQvbCvwVBEH+eynWFY/KSWY8
eLj3fBQfv3rJl5uimByet/fNZnJbTD7dfbv7/nEybaur9eHY7NeLqlV++UpRvIRvry2rY932CxBy
BjhDCL8JWvNY77yGc7DSia68Wj+sLmVrZFfeNE+XqlBdcbFpDvWlbLTu6tXyzwciSYmu087N5rQN
igOHcYHTzv/qdDjWy58DHYtVtXto6zAHELYvfK33i3p3DLrQSkT9/FQ9Xh4l7qe6rwPKz9XuVO2f
C4RpIeSkN/TLud7/WG+7Vdu5oeN1Ok4aSp60iJQIaV1ypJEFLV3sTUEbbWT8IzvQon3suCwDuteR
gAbtegIFDVqBQmXexxrKDNb/R+fhdhxuY4hZCW4TyXa0Ddk/pS2GbU0kAlsLG7fOwk46EtgWsCdQ
2EZb8i/lkXYZpMPcPMyGxaw4yh4+Q1mx6UF7U8pa+A+DeZQwDxfHjIymxMg+j63JYBvm5rHVHFst
/MuSCVc5EXsTunFnvcQAI+MOiYmtAxg3cdJBOaMaMTHOJZfLMT/eUtbXKaPMDGXF2hd0XJ8glgxi
jZK4iNoUhxhrZRwXFOiV0eOv19ExnrW+cm/yOkL2DbY0louKMdDqCuiwbhicB1uyflY6bonC1swJ
qAfSAoYy2VhLTs3IWpSqjKM41mlHkhu67Kc1DQ7t3673WlpetzSEuXmgBetqS040AtoxZ59G3tRq
8OyD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AAA==
headers:
Access-Control-Allow-Credentials:
- 'true'
Expand All @@ -44,9 +45,9 @@ interactions:
Content-Type:
- application/json; charset=utf-8
Date:
- Thu, 29 Feb 2024 04:42:50 GMT
- Thu, 09 May 2024 15:33:04 GMT
Etag:
- W/"cd0-Rv/ywzhqPUdb7KJ/ZDpUXIC8K1A"
- W/"cf8-QiT4ARSPwS2WpuJ8xk9gvh9vqrg"
Server:
- nginx/1.18.0 (Ubuntu)
Transfer-Encoding:
Expand Down

0 comments on commit 6700cce

Please sign in to comment.