mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-11 11:16:15 +08:00
DEV: Uses ValueError when PerformanceTracker.to_dict receives invalid emission type
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user