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:
Eddie Hebert
2013-05-08 20:58:28 -04:00
parent 5a2a51f796
commit 24019de573
+7 -2
View File
@@ -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,