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

hotfix / no window if raw/export #4809

Merged
merged 4 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
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 @@ -137,4 +137,4 @@ def display_sentiment_analysis(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,4 @@ def display_crypto_sentiment_analysis(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)
2 changes: 1 addition & 1 deletion openbb_terminal/cryptocurrency/nft/nftpricefloor_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,4 @@ def display_floor_price(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)
2 changes: 1 addition & 1 deletion openbb_terminal/cryptocurrency/onchain/shroom_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def display_dapp_stats(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)


@log_start_end(log=logger)
Expand Down
21 changes: 5 additions & 16 deletions openbb_terminal/cryptocurrency/overview/blockchaincenter_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,24 +57,13 @@ def display_altcoin_index(
fig.set_title(f"Altcoin Index (Performance based on {period} days)")
fig.add_scatter(x=df.index, y=df["Value"], mode="lines", name="Altcoin Index")

fig.add_hline(
y=75,
line_color=theme.up_color,
annotation=dict(
text="Altcoin Season (75)",
x=0.5,
xanchor="center",
),
fig.add_hline_legend(
y=75, line=dict(color=theme.up_color), name="Altcoin Season (75)"
)
fig.add_hline(
fig.add_hline_legend(
y=25,
line_color=theme.down_color,
annotation=dict(
text="Bitcoin Season (25)",
x=0.5,
xanchor="center",
yshift=-30,
),
line=dict(color=theme.down_color),
name="Bitcoin Season (25)",
)

export_data(
Expand Down
2 changes: 2 additions & 0 deletions openbb_terminal/dashboards/streamlit.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def main():
"server.enableCORS": False,
"server.enableXsrfProtection": False,
"browser.serverAddress": "localhost",
"theme.font": "Fira Code, monospace",
"theme.base": "dark",
}

streamlit.web.bootstrap.load_config_options(flag_options=flag_options)
Expand Down
12 changes: 6 additions & 6 deletions openbb_terminal/economy/alphavantage_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def display_real_gdp(
fig,
)
if raw:
print_rich_table(
return print_rich_table(
gdp,
headers=["Date", "GDP"],
show_index=False,
Expand Down Expand Up @@ -192,7 +192,7 @@ def display_gdp_capita(
fig,
)
if raw:
print_rich_table(
return print_rich_table(
gdp,
headers=["Date", "GDP"],
show_index=False,
Expand Down Expand Up @@ -251,7 +251,7 @@ def display_inflation(
fig,
)
if raw:
print_rich_table(
return print_rich_table(
inf,
headers=["Date", "Inflation"],
show_index=False,
Expand Down Expand Up @@ -316,7 +316,7 @@ def display_cpi(
fig,
)
if raw:
print_rich_table(
return print_rich_table(
cpi,
headers=["Date", "CPI"],
show_index=False,
Expand Down Expand Up @@ -382,7 +382,7 @@ def display_treasury_yield(
fig,
)
if raw:
print_rich_table(
return print_rich_table(
yld,
headers=["Date", "Yield"],
title="Historical Treasury Yield",
Expand Down Expand Up @@ -444,7 +444,7 @@ def display_unemployment(
)

if raw:
print_rich_table(
return print_rich_table(
un,
headers=["Date", "GDP"],
title="US Unemployment",
Expand Down
4 changes: 2 additions & 2 deletions openbb_terminal/economy/econdb_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def show_macro_data(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)


@log_start_end(log=logger)
Expand Down Expand Up @@ -228,7 +228,7 @@ def show_treasuries(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)


@log_start_end(log=logger)
Expand Down
2 changes: 1 addition & 1 deletion openbb_terminal/economy/fred_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def plot_cpi(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)


def format_data_to_plot(data: pd.DataFrame, detail: dict) -> Tuple[pd.DataFrame, str]:
Expand Down
2 changes: 1 addition & 1 deletion openbb_terminal/economy/nasdaq_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def display_big_mac_index(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)

logger.error("Unable to get big mac data")
return console.print("[red]Unable to get big mac data[/red]\n")
18 changes: 9 additions & 9 deletions openbb_terminal/economy/oecd_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def plot_gdp(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)


@log_start_end(log=logger)
Expand Down Expand Up @@ -228,7 +228,7 @@ def plot_real_gdp(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)


@log_start_end(log=logger)
Expand Down Expand Up @@ -339,7 +339,7 @@ def plot_gdp_forecast(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)


@log_start_end(log=logger)
Expand Down Expand Up @@ -448,7 +448,7 @@ def plot_cpi(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)


@log_start_end(log=logger)
Expand Down Expand Up @@ -530,7 +530,7 @@ def plot_balance(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)


@log_start_end(log=logger)
Expand Down Expand Up @@ -625,7 +625,7 @@ def plot_revenue(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)


@log_start_end(log=logger)
Expand Down Expand Up @@ -727,7 +727,7 @@ def plot_spending(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)


@log_start_end(log=logger)
Expand Down Expand Up @@ -808,7 +808,7 @@ def plot_debt(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)


@log_start_end(log=logger)
Expand Down Expand Up @@ -892,4 +892,4 @@ def plot_trust(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)
2 changes: 1 addition & 1 deletion openbb_terminal/economy/yfinance_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def show_indices(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)


@log_start_end(log=logger)
Expand Down
2 changes: 1 addition & 1 deletion openbb_terminal/fixedincome/ecb_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,4 @@ def display_ecb_yield_curve(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)
20 changes: 10 additions & 10 deletions openbb_terminal/fixedincome/fred_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ def plot_fed(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)


@log_start_end(log=logger)
Expand Down Expand Up @@ -707,7 +707,7 @@ def plot_projection(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)


@log_start_end(log=logger)
Expand Down Expand Up @@ -833,7 +833,7 @@ def plot_ecb(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)


@log_start_end(log=logger)
Expand Down Expand Up @@ -1012,7 +1012,7 @@ def display_yield_curve(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)


@log_start_end(log=logger)
Expand Down Expand Up @@ -1106,7 +1106,7 @@ def plot_usrates(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)


@log_start_end(log=logger)
Expand Down Expand Up @@ -1286,7 +1286,7 @@ def plot_icebofa(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)


@log_start_end(log=logger)
Expand Down Expand Up @@ -1360,7 +1360,7 @@ def plot_moody(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)


@log_start_end(log=logger)
Expand Down Expand Up @@ -1465,7 +1465,7 @@ def plot_cp(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)


@log_start_end(log=logger)
Expand Down Expand Up @@ -1560,7 +1560,7 @@ def plot_spot(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)


@log_start_end(log=logger)
Expand Down Expand Up @@ -1628,4 +1628,4 @@ def plot_hqm(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)
2 changes: 1 addition & 1 deletion openbb_terminal/fixedincome/oecd_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ def plot_treasuries(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)
2 changes: 1 addition & 1 deletion openbb_terminal/futures/databento_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ def display_historical(
figure,
)

return figure.show(external=external_axes) # type: ignore
return figure.show(external=raw or external_axes) # type: ignore
2 changes: 2 additions & 0 deletions openbb_terminal/helper_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1592,6 +1592,8 @@ def export_data(

console.print(f"Saved file: {saved_path}")

figure._exported = True # pylint: disable=protected-access


def get_rf() -> float:
"""Use the fiscaldata.gov API to get most recent T-Bill rate.
Expand Down
2 changes: 1 addition & 1 deletion openbb_terminal/portfolio/portfolio_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ def display_yearly_returns(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)


@log_start_end(log=logger)
Expand Down
4 changes: 2 additions & 2 deletions openbb_terminal/stocks/comparison_analysis/finbrain_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def display_sentiment_compare(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)


@log_start_end(log=logger)
Expand Down Expand Up @@ -194,4 +194,4 @@ def display_sentiment_correlation(
sheet_name,
fig,
)
return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def display_correlation(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)


@log_start_end(log=logger)
Expand Down
2 changes: 1 addition & 1 deletion openbb_terminal/stocks/dark_pool_shorts/quandl_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,4 @@ def short_interest(
fig,
)

return fig.show(external=external_axes)
return fig.show(external=raw or external_axes)
Loading