From d686fac02d9dee15aad13f6ff7e20d02f6c7227b Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Sun, 5 May 2013 04:43:10 -0400 Subject: [PATCH] MAINT: Use property for tradesimulation perf_key. --- zipline/gens/tradesimulation.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/zipline/gens/tradesimulation.py b/zipline/gens/tradesimulation.py index 69078570..dd409f05 100644 --- a/zipline/gens/tradesimulation.py +++ b/zipline/gens/tradesimulation.py @@ -54,9 +54,6 @@ class AlgorithmSimulator(object): second=0, microsecond=0) - self.perf_key = self.EMISSION_TO_PERF_KEY_MAP[ - self.algo.perf_tracker.emission_rate] - # ============== # Snapshot Setup # ============== @@ -82,6 +79,11 @@ class AlgorithmSimulator(object): record.extra['algo_dt'] = self.snapshot_dt self.processor = Processor(inject_algo_dt) + @property + def perf_key(self): + return self.EMISSION_TO_PERF_KEY_MAP[ + self.algo.perf_tracker.emission_rate] + def transform(self, stream_in): """ Main generator work loop.