diff --git a/zipline/protocol.py b/zipline/protocol.py index 562a18bb..b5318b18 100644 --- a/zipline/protocol.py +++ b/zipline/protocol.py @@ -14,7 +14,7 @@ # limitations under the License. -from utils.protocol_utils import Enum, ndict, namelookup +from utils.protocol_utils import Enum, ndict # Datasource type should completely determine the other fields of a # message with its type. @@ -34,9 +34,3 @@ TRANSFORM_TYPE = ndict({ 'PASSTHROUGH': 'PASSTHROUGH', 'EMPTY': '' }) - - -FINANCE_COMPONENT = namelookup({ - 'TRADING_CLIENT': 'TRADING_CLIENT', - 'PORTFOLIO_CLIENT': 'PORTFOLIO_CLIENT', -}) diff --git a/zipline/utils/protocol_utils.py b/zipline/utils/protocol_utils.py index 15786db1..9a085d3f 100644 --- a/zipline/utils/protocol_utils.py +++ b/zipline/utils/protocol_utils.py @@ -148,28 +148,3 @@ class ndict(MutableMapping): #return False #return True - - -# This is not neccesarily the most intuitive construction, but -# we're aiming for raw performance rather than readability. So -# we do things that we would not normally do in business logic. -def namelookup(dct): - ks = dct.keys() - vs = dct.values() - dct = {} - - class _lookup: - __slots__ = ks - - def __init__(self): - for k, v in zip(ks, vs): - setattr(self, k, v) - self.__setattr__ = self.locked - - def locked(self, k, v): - raise Exception('Name lookups are fixed at init.') - - def __repr__(self): - return '' % self.__slots__ - del dct - return _lookup()