Skip to content

Commit

Permalink
Release Cleanup (#5233)
Browse files Browse the repository at this point in the history
* turn hold off when run even if no figure

* Add warning text to PlotlyTA

* better wording

* fixes #5232

* Fix askobb + updaate reqs

* bump requests

* Couple other bumps

* Here we go with the mac builds

* That wasn't right

* Not gonna have a good time today

* Previous miniconda

* did that wrong

* Wrong version

* ?

* installer-url instead

* 3.1 not 5.1

* CONDA UPDATE

* Revert the mac builds

* Run poetry lock and update some packages

* bump poetry on unit test

* Fix one test

* Add vanilla 3.11

* Fix issue on runner

* One last try

* Remove windows conda :D
  • Loading branch information
jmaslek authored Jul 20, 2023
1 parent 41ef3d4 commit 87b5bdb
Show file tree
Hide file tree
Showing 9 changed files with 3,834 additions and 2,945 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.4.0
version: 1.5.1
virtualenvs-create: true
virtualenvs-in-project: true

Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest]
exclude:
- os: ubuntu-latest
Expand All @@ -134,7 +134,7 @@ jobs:
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.4.0
version: 1.5.1
virtualenvs-create: true
virtualenvs-in-project: true

Expand All @@ -161,7 +161,6 @@ jobs:
run: |
source $VENV
pip list
- name: Run tests
env:
MPLBACKEND: Agg
Expand All @@ -182,7 +181,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest, macos-latest]
exclude:
- os: ubuntu-latest
Expand All @@ -200,7 +199,7 @@ jobs:
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.4.0
version: 1.5.1
virtualenvs-create: true
virtualenvs-in-project: true

Expand Down Expand Up @@ -249,7 +248,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ["ubuntu", "windows", "macos"]
os: ["ubuntu", "macos"]
python-version: ["3.9"]
dependencies: [""]
include:
Expand Down
9 changes: 8 additions & 1 deletion openbb_terminal/core/plots/plotly_ta/ta_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import pandas as pd

from openbb_terminal import OpenBBFigure, theme
from openbb_terminal import OpenBBFigure, config_terminal, theme
from openbb_terminal.common.technical_analysis import ta_helpers
from openbb_terminal.core.config.paths import REPOSITORY_DIRECTORY
from openbb_terminal.core.plots.plotly_ta.base import PltTA
Expand Down Expand Up @@ -144,6 +144,13 @@ def __plot__(
volume_ticks_x: int = 7,
) -> OpenBBFigure:
"""This method should not be called directly. Use the PlotlyTA.plot() static method instead."""

if config_terminal.HOLD:
console.print(
"The previous command is not supported within hold on. Only the last command run"
"will be displayed when hold off is run."
)

if isinstance(df_stock, pd.Series):
df_stock = df_stock.to_frame()

Expand Down
1 change: 1 addition & 0 deletions openbb_terminal/miscellaneous/i18n/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ en:
stocks/ta/_custom_: Custom
stocks/ta/fib: fibonacci retracement
stocks/ta/multi: plot multiple indicators on the same chart
stocks/ta/ichimoku: Ichimoku Kinko Hyo indicator
stocks/qa/load: load new ticker
stocks/qa/pick: pick target column for analysis
stocks/qa/_ticker: Ticker
Expand Down
108 changes: 55 additions & 53 deletions openbb_terminal/parent_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

# IMPORTS THIRDPARTY
import numpy as np
import openai
import pandas as pd
from prompt_toolkit.formatted_text import HTML
from prompt_toolkit.styles import Style
Expand Down Expand Up @@ -318,65 +319,65 @@ def call_hold(self, other_args: List[str]) -> None:
config_terminal.set_same_axis()
else:
config_terminal.set_new_axis()
if (
ns_parser.option == "off"
and config_terminal.get_current_figure() is not None
):
if ns_parser.option == "off":
config_terminal.HOLD = False
# create a subplot
fig = config_terminal.get_current_figure()
if fig is None:
return
if not fig.has_subplots and not config_terminal.make_new_axis():
fig.set_subplots(1, 1, specs=[[{"secondary_y": True}]])

if config_terminal.make_new_axis():
for i, trace in enumerate(fig.select_traces()):
trace.yaxis = f"y{i+1}"

if i != 0:
fig.update_layout(
{
f"yaxis{i+1}": dict(
side="left",
overlaying="y",
showgrid=True,
showline=False,
zeroline=False,
automargin=True,
ticksuffix=" " * (i - 1) if i > 1 else "",
tickfont=dict(
size=18,
color=_TerminalStyle().get_colors()[i],
),
title=dict(
font=dict(
size=15,
if config_terminal.get_current_figure() is not None:
# create a subplot
fig = config_terminal.get_current_figure()
if fig is None:
return
if not fig.has_subplots and not config_terminal.make_new_axis():
fig.set_subplots(1, 1, specs=[[{"secondary_y": True}]])

if config_terminal.make_new_axis():
for i, trace in enumerate(fig.select_traces()):
trace.yaxis = f"y{i+1}"

if i != 0:
fig.update_layout(
{
f"yaxis{i+1}": dict(
side="left",
overlaying="y",
showgrid=True,
showline=False,
zeroline=False,
automargin=True,
ticksuffix=" " * (i - 1)
if i > 1
else "",
tickfont=dict(
size=18,
color=_TerminalStyle().get_colors()[i],
),
title=dict(
font=dict(
size=15,
),
standoff=0,
),
standoff=0,
),
),
}
)
# pylint: disable=undefined-loop-variable
fig.update_layout(margin=dict(l=30 * i))
}
)
# pylint: disable=undefined-loop-variable
fig.update_layout(margin=dict(l=30 * i))

else:
fig.update_yaxes(title="")
else:
fig.update_yaxes(title="")

if any(config_terminal.get_legends()):
for trace, new_name in zip(
fig.select_traces(), config_terminal.get_legends()
):
if new_name:
trace.name = new_name
if any(config_terminal.get_legends()):
for trace, new_name in zip(
fig.select_traces(), config_terminal.get_legends()
):
if new_name:
trace.name = new_name

fig.update_layout(title=" ".join(ns_parser.title))
fig.show()
config_terminal.COMMAND_ON_CHART = True
fig.update_layout(title=" ".join(ns_parser.title))
fig.show()
config_terminal.COMMAND_ON_CHART = True

config_terminal.set_current_figure(None)
config_terminal.reset_legend()
config_terminal.set_current_figure(None)
config_terminal.reset_legend()

def call_askobb(self, other_args: List[str]) -> None:
"""Accept user input as a string and return the most appropriate Terminal command"""
Expand Down Expand Up @@ -425,7 +426,6 @@ def call_askobb(self, other_args: List[str]) -> None:
console.print("[red]Please enter a prompt with more than 1 word[/red]")
else:
api_key = get_current_user().credentials.API_OPENAI_KEY

if ns_parser.gpt_model == "gpt-4" and api_key == "REPLACE_ME":
console.print(
"[red]GPT-4 only available with local OPENAI Key.\n[/]"
Expand All @@ -443,6 +443,8 @@ def call_askobb(self, other_args: List[str]) -> None:
"[yellow]Using local OpenAI Key"
". Please remove from OpenBB Hub to query askobb remotely.[/]\n"
)
# This is needed to avoid authentication error
openai.api_key = api_key
response, source_nodes = query_LLM_local(
" ".join(ns_parser.question), ns_parser.gpt_model
)
Expand Down
Loading

0 comments on commit 87b5bdb

Please sign in to comment.