From 7443b0c6028971c58f4fc4e19459a00378ff4be0 Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Wed, 30 Jan 2013 16:20:58 -0500 Subject: [PATCH] Pulls alias_dt wrapper out of sequential_transforms. So that stepping through/cProfile output are a little clearer. --- zipline/algorithm.py | 6 ++++-- zipline/gens/composites.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/zipline/algorithm.py b/zipline/algorithm.py index f0ae7b8b..032af464 100644 --- a/zipline/algorithm.py +++ b/zipline/algorithm.py @@ -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) diff --git a/zipline/gens/composites.py b/zipline/gens/composites.py index e58390ed..dba86587 100644 --- a/zipline/gens/composites.py +++ b/zipline/gens/composites.py @@ -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):