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

Add LRU eviction with 1gb memory limit for PandasData #392

Merged
merged 15 commits into from
Mar 12, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Handle empty dataframes (which occur more commonly now that get_price…
…_data_from_polygon will return them).
  • Loading branch information
Jim White committed Mar 10, 2024
commit 83cf7218d851185c454089d3daac2e0c2026bac8
5 changes: 1 addition & 4 deletions lumibot/backtesting/polygon_backtesting.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,12 @@ def update_pandas_data(self, asset, quote, length, timestep, start_dt=None, upda
logging.error(traceback.format_exc())
raise Exception("Error getting data from Polygon") from e

if df is None:
if (df is None) or df.empty:
return

data = Data(asset_separated, df, timestep=ts_unit, quote=quote_asset)
pandas_data_update = self._set_pandas_data_keys([data])

if pandas_data_update is None:
return

# Add the keys to the self.pandas_data dictionary
self.pandas_data.update(pandas_data_update)
# Don't let memory usage get out of control
Expand Down