Skip to content

Commit

Permalink
Merge pull request #238 from c0indev3l/patch-1
Browse files Browse the repository at this point in the history
Make some errors more explicit
  • Loading branch information
EmersonDove authored Dec 23, 2023
2 parents e547564 + 12ee1f4 commit 7fe1976
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions blankly/data/data_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def _parse_df_prices(self, file_paths: list, symbols: list, columns: set) -> Non
self._check_length(file_paths[index], file_paths[index])

# Check if its contained
assert (columns.issubset(file_paths[index].columns))
assert (columns.issubset(file_paths[index].columns)), f"{columns} not subset of {file_paths[index].columns}"

# Now push it directly into the dataset and sort by time
self._internal_dataset[symbols[index]] = file_paths[index].sort_values('time')
Expand All @@ -130,7 +130,7 @@ def _parse_csv_prices(self, file_paths: list, symbols: list, columns: set) -> No
self._check_length(contents, file_paths[index])

# Check if its contained
assert (columns.issubset(contents.columns))
assert (columns.issubset(contents.columns)), f"{columns} not subset of {contents.columns}"

# Now push it directly into the dataset and sort by time
self._internal_dataset[symbols[index]] = contents.sort_values('time')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,10 @@ def get_account(self, symbol=None) -> utils.AttributeDict:
return self.local_account.get_account(symbol)
except KeyError:
if self.backtesting:
raise KeyError("Symbol not found. This can be caused by an invalid quote currency "
raise KeyError(f"Symbol {symbol} not found. This can be caused by an invalid quote currency "
"in backtest.json.")
else:
raise KeyError("Symbol not found.")
raise KeyError(f"Symbol {symbol} not found.")

def take_profit_order(self, symbol: str, price: float, size: float) -> TakeProfitOrder:
# we don't simulate partial fills, this is the same as take_profit
Expand Down

0 comments on commit 7fe1976

Please sign in to comment.