Pulls alias_dt wrapper out of sequential_transforms.

So that stepping through/cProfile output are a little clearer.
This commit is contained in:
Eddie Hebert
2013-01-30 16:20:58 -05:00
parent 946ecfafc0
commit 7443b0c602
2 changed files with 5 additions and 3 deletions
+4 -2
View File
@@ -36,7 +36,8 @@ from zipline.finance.constants import ANNUALIZER
from zipline.gens.composites import (
date_sorted_sources,
sequential_transforms
sequential_transforms,
alias_dt
)
from zipline.gens.tradesimulation import TradeSimulationClient as tsc
from zipline import MESSAGES
@@ -120,9 +121,10 @@ class TradingAlgorithm(object):
self.date_sorted = date_sorted_sources(*self.sources)
self.with_tnfms = sequential_transforms(self.date_sorted,
*self.transforms)
self.with_alias_dt = alias_dt(self.with_tnfms)
# Group together events with the same dt field. This depends on the
# events already being sorted.
self.grouped_by_date = groupby(self.with_tnfms, attrgetter('dt'))
self.grouped_by_date = groupby(self.with_alias_dt, attrgetter('dt'))
self.trading_client = tsc(self, environment)
transact_method = transact_partial(self.slippage, self.commission)
+1 -1
View File
@@ -51,7 +51,7 @@ def sequential_transforms(stream_in, *transforms):
transforms,
stream_in)
return alias_dt(stream_out)
return stream_out
def alias_dt(stream_in):