Moving exports into openbb_terminal folder. (#2859)

* Move export

* Black

Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt>
This commit is contained in:
Chavithra
2022-10-15 19:56:51 +02:00
committed by GitHub
parent 689223957e
commit 74c8eae2d3
30 changed files with 9 additions and 7 deletions

View File

@@ -12,6 +12,7 @@ import pandas as pd
from pandas import DataFrame
import numpy as np
from openbb_terminal.core.config.paths import MISCELLANEOUS_DIRECTORY
from openbb_terminal.decorators import log_start_end
from openbb_terminal.rich_config import console
@@ -22,7 +23,7 @@ default_files = {
filepath.name: filepath
for file_type in ["csv", "xlsx"]
for filepath in chain(
Path("exports").rglob(f"*.{file_type}"),
(MISCELLANEOUS_DIRECTORY / "exports").rglob(f"*.{file_type}"),
Path("custom_imports").rglob(f"*.{file_type}"),
)
if filepath.is_file()

View File

@@ -21,6 +21,7 @@ from scipy.stats import binom
import openbb_terminal.config_plot as cfp
from openbb_terminal.config_plot import PLOT_DPI
from openbb_terminal.config_terminal import theme
from openbb_terminal.core.config.paths import MISCELLANEOUS_DIRECTORY
from openbb_terminal.decorators import log_start_end
from openbb_terminal.helper_funcs import (
excel_columns,
@@ -1049,12 +1050,12 @@ def export_binomial_calcs(
for j, _ in enumerate(opt_vals[i]):
ws[f"{opts[i]}{j+8+days}"] = opt_vals[i][j]
trypath = os.path.join(
os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "..")),
"exports",
"stocks",
"options",
f"{symbol} {datetime.now()}.xlsx",
trypath = str(
MISCELLANEOUS_DIRECTORY
/ "exports"
/ "stocks"
/ "options"
/ f"{symbol} {datetime.now()}.xlsx"
)
wb.save(trypath)
console.print(