From 4723e836e7b05fcc0c182bd349fe20dd4ca48505 Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Wed, 23 Jan 2013 09:30:26 -0500 Subject: [PATCH] Changes use of ndict in transforms to be name object. So that when inspecting memory, it's easier to find each datatype. --- zipline/transforms/utils.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/zipline/transforms/utils.py b/zipline/transforms/utils.py index e343a40c..40fb3556 100644 --- a/zipline/transforms/utils.py +++ b/zipline/transforms/utils.py @@ -28,13 +28,17 @@ from numbers import Integral import pandas as pd -from zipline import ndict +from zipline.protocol import Event from zipline.utils.tradingcalendar import non_trading_days from zipline.gens.utils import assert_sort_unframe_protocol, hash_args log = logbook.Logger('Transform') +class TransformMessage(object): + pass + + class Passthrough(object): PASSTHROUGH = True """ @@ -149,7 +153,7 @@ class StatefulTransform(object): # the calculated tnfm_value. This is the default behavior # for a non-passthrough transform being fed into a merge. elif self.merged: - out_message = ndict() + out_message = TransformMessage() out_message.tnfm_id = self.namestring out_message.tnfm_value = tnfm_value out_message.dt = message.dt @@ -426,7 +430,7 @@ class BatchTransform(EventWindow): # couple of seconds shouldn't matter. We don't add it to # the data parameter, because it would mix dt with the # sid keys. - event = ndict() + event = Event() event.dt = max(dts) event.data = data