PERF: Don't round until after we hstack.

This commit is contained in:
Scott Sanderson
2016-10-26 23:30:12 -04:00
parent 1e889987eb
commit 0cbc2ca388
+4 -4
View File
@@ -19,7 +19,7 @@ from abc import (
)
from lru import LRU
from numpy import around, hstack
from numpy import hstack
from pandas import isnull
from pandas.tslib import normalize_date
from toolz import sliding_window
@@ -271,7 +271,7 @@ class SlidingWindow(object):
def __init__(self, window, size, cal_start, offset):
self.window = window
self.cal_start = cal_start
self.current = around(next(window), 3)
self.current = next(window)
self.offset = offset
self.most_recent_ix = self.cal_start + size
@@ -286,7 +286,7 @@ class SlidingWindow(object):
return self.current
target = end_ix - self.cal_start - self.offset + 1
self.current = around(self.window.seek(target), 3)
self.current = self.window.seek(target)
self.most_recent_ix = end_ix
return self.current
@@ -522,7 +522,7 @@ class HistoryLoader(with_metaclass(ABCMeta)):
field,
is_perspective_after)
end_ix = self._calendar.get_loc(dts[-1])
return hstack([window.get(end_ix) for window in block])
return hstack([window.get(end_ix) for window in block]).round(3)
class DailyHistoryLoader(HistoryLoader):