Merge pull request #55 from quantopian/fawce_alpha1

Fawce alpha1
This commit is contained in:
Stephen Diehl
2012-05-28 13:09:10 -07:00
2 changed files with 6 additions and 3 deletions
+4 -1
View File
@@ -308,7 +308,10 @@ class RiskMetrics():
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)
message = message.format(
dt=self.end_date,
term=self.treasury_duration
)
raise Exception(message)
+2 -2
View File
@@ -44,10 +44,10 @@ def EPOCH(utc_datetime):
delta = utc_datetime - UNIX_EPOCH
seconds = delta.total_seconds()
ms = seconds * 1000
return ms
return int(ms)
def UN_EPOCH(ms_since_epoch):
seconds_since_epoch = ms_since_epoch / 1000
seconds_since_epoch = float(ms_since_epoch) / 1000.0
delta = timedelta(seconds = seconds_since_epoch)
dt = UNIX_EPOCH + delta
return dt