Merge pull request #23 from quantopian/integration

fixed bug where year report list included months instead. added a period...
This commit is contained in:
fawce
2012-04-04 15:05:35 -07:00
+4 -2
View File
@@ -123,6 +123,7 @@ class RiskMetrics():
Creates a dictionary representing the state of the risk report.
Returns a dict object of the form:
"""
period_label = self.end_date.strftime("%Y-%m")
return {
'trading_days' : self.trading_days,
'benchmark_volatility' : self.benchmark_volatility,
@@ -134,7 +135,8 @@ class RiskMetrics():
'beta' : self.beta,
'alpha' : self.alpha,
'excess_return' : self.excess_return,
'max_drawdown' : self.max_drawdown
'max_drawdown' : self.max_drawdown,
'period_label' : period_label
}
def __repr__(self):
@@ -345,7 +347,7 @@ class RiskReport():
'1_month' : [x.to_dict() for x in self.month_periods],
'3_month' : [x.to_dict() for x in self.three_month_periods],
'6_month' : [x.to_dict() for x in self.six_month_periods],
'12_month' : [x.to_dict() for x in self.month_periods]
'12_month' : [x.to_dict() for x in self.year_periods]
}
def periodsInRange(self, months_per, start, end):