DEV: Uses ValueError when PerformanceTracker.to_dict receives invalid emission type

This commit is contained in:
jfkirk
2015-07-21 16:06:52 -04:00
parent 8d5bfd3c91
commit 16ab46b69c
2 changed files with 4 additions and 5 deletions
+1 -1
View File
@@ -298,7 +298,7 @@ class PerformanceTracker(object):
_dict['minute_perf'] = self.todays_performance.to_dict(
self.saved_dt)
else:
raise BaseException("Invalid emission type: %s" % emission_type)
raise ValueError("Invalid emission type: %s" % emission_type)
return _dict
+3 -4
View File
@@ -121,9 +121,8 @@ class AlgorithmSimulator(object):
)
# Perf messages are only emitted if the snapshot contained
# a benchmark event.
if messages is not None:
for message in messages:
yield message
for message in messages:
yield message
# When emitting minutely, we need to call
# before_trading_start before the next trading day begins
@@ -315,7 +314,7 @@ class AlgorithmSimulator(object):
if benchmark_event_occurred:
return self.generate_messages(dt)
else:
return None
return ()
def _call_handle_data(self):
"""