mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-17 11:25:55 +08:00
Removes assert of message confirming to protocol.
Two reasons for removal: - On the path of removing most non-postconditional asserts. Since the asserts on every message is incurring a non-insignificant penalty on large datasets. - Since the assert was invoked as a function, the 'right side' of the assert statement, i.e. the error message was being invoked as a function, discovered since the __repr__ of the message was high on the bottleneck list.
This commit is contained in:
@@ -20,7 +20,6 @@ import logbook
|
||||
|
||||
from collections import deque
|
||||
from zipline.gens.utils import (
|
||||
assert_datasource_unframe_protocol,
|
||||
assert_sort_protocol
|
||||
)
|
||||
|
||||
@@ -44,10 +43,6 @@ def date_sort(stream_in, source_ids):
|
||||
|
||||
# Process incoming streams.
|
||||
for message in stream_in:
|
||||
# Incoming messages should be the output of DATASOURCE_UNFRAME.
|
||||
assert_datasource_unframe_protocol(message), \
|
||||
"Bad message in date_sort: %s" % message
|
||||
|
||||
# Only allow messages from sources we expect.
|
||||
assert message.source_id in sources, "Unexpected source: %s" % message
|
||||
|
||||
|
||||
Reference in New Issue
Block a user