From 19f00e867b4646ae648f8bdaddde500f49a4f8fc Mon Sep 17 00:00:00 2001 From: fawce Date: Sun, 12 Aug 2012 00:53:23 -0400 Subject: [PATCH] indentation bug --- zipline/finance/risk.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/zipline/finance/risk.py b/zipline/finance/risk.py index 5c42cf69..66825eba 100644 --- a/zipline/finance/risk.py +++ b/zipline/finance/risk.py @@ -307,23 +307,22 @@ class RiskMetrics(): for i in xrange(7): if(self.treasury_curves.has_key(self.end_date + i * one_day)): curve = self.treasury_curves[self.end_date + i * one_day] - - if curve: self.treasury_curve = curve rate = self.treasury_curve[self.treasury_duration] #1month note data begins in 8/2001, so we can use 3month instead. if rate == None and self.treasury_duration == '1month': rate = self.treasury_curve['3month'] + if rate != None: return rate * (td.days + 1) / 365 - message = "no rate for end date = {dt} and term = {term}. Check \ - that date doesn't exceed treasury history range." - message = message.format( - dt=self.end_date, - term=self.treasury_duration - ) - raise Exception(message) + message = "no rate for end date = {dt} and term = {term}. Check \ + that date doesn't exceed treasury history range." + message = message.format( + dt=self.end_date, + term=self.treasury_duration + ) + raise Exception(message)