Files
catalyst/zipline/components/passthrough.py
T
Stephen Diehl fefca77fe2 FSM for Feed
2012-06-11 09:26:48 -04:00

19 lines
550 B
Python

from zipline.transforms import BaseTransform
from zipline.protocol import FEED_FRAME, TRANSFORM_TYPE
class PassthroughTransform(BaseTransform):
"""
A bypass transform passes data through unchanged.
"""
def init(self):
self.props = { 'name': 'PASSTHROUGH' }
#TODO, could save some cycles by skipping the _UNFRAME call
# and just setting value to original msg string.
def transform(self, event):
return {
'name' : TRANSFORM_TYPE.PASSTHROUGH,
'value' : FEED_FRAME(event)
}