mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-04 20:06:18 +08:00
BUG: Paper over multiple types for algorithm returns.
The Seriess-style indexing causes a crash on the list during unit tests.
TODO: Investigate whether the list type of algorithm returns can
be removed.
This commit is contained in:
@@ -837,8 +837,13 @@ class RiskReport(object):
|
||||
start_date = self.sim_params.period_start
|
||||
end_date = self.sim_params.period_end
|
||||
else:
|
||||
start_date = self.algorithm_returns.index[0]
|
||||
end_date = self.algorithm_returns.index[-1]
|
||||
# FIXME: Papering over multiple algorithm_return types
|
||||
if isinstance(self.algorithm_returns, list):
|
||||
start_date = self.algorithm_returns[0].date
|
||||
end_date = self.algorithm_returns[-1].date
|
||||
else:
|
||||
start_date = self.algorithm_returns.index[0]
|
||||
end_date = self.algorithm_returns.index[-1]
|
||||
|
||||
self.month_periods = self.periods_in_range(1, start_date, end_date)
|
||||
self.three_month_periods = self.periods_in_range(3, start_date,
|
||||
|
||||
Reference in New Issue
Block a user