Skip to content

Commit

Permalink
Minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
JerBouma committed Jan 9, 2024
1 parent 588f50a commit 0cc1496
Show file tree
Hide file tree
Showing 24 changed files with 1,231 additions and 7 deletions.
5 changes: 4 additions & 1 deletion financetoolkit/historical_model.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Historical Module"""
__docformat__ = "google"

import contextlib
import threading
import time
from datetime import datetime, timedelta
Expand Down Expand Up @@ -557,7 +558,9 @@ def enrich_historical_data(
historical_data["Cumulative Return"] = 1

adjusted_return = historical_data.loc[start:end, "Return"].copy()
adjusted_return.iloc[0] = 0

with contextlib.suppress(IndexError):
adjusted_return.iloc[0] = 0

historical_data["Cumulative Return"] = pd.Series(np.nan).astype(float)

Expand Down
6 changes: 0 additions & 6 deletions financetoolkit/toolkit_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,12 +497,6 @@ def ratios(self) -> Ratios:
if self._cash_flow_statement.empty:
empty_data.append("Cash Flow Statement")

empty_data_iterator = (
tqdm(empty_data, desc="Obtaining financial statements")
if ENABLE_TQDM & self._progress_bar
else empty_data
)

if empty_data:
empty_data_iterator = (
tqdm(empty_data, desc="Obtaining financial statements")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
,0
0,0.6666666666666666
1,1.6
2,2.7
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
,AAPL,MSFT
2020,8318.9299,57852.0784
2021,160.2573,306.022
2022,155.4936,279.3459
Loading

0 comments on commit 0cc1496

Please sign in to comment.