mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-28 17:00:51 +08:00
BUG: Enforce sorted order on minutes to delete.
The intervals are returned as a set, so order is not guaranteed, which becomes exposed when reading windows which span multiple years. The deletion of values from the regular sized minute array assumes that intervals can be reversed to delete the array from the back.
This commit is contained in:
@@ -47,7 +47,10 @@ from zipline.data.minute_bars import (
|
||||
from zipline.finance.trading import TradingEnvironment
|
||||
|
||||
|
||||
TEST_CALENDAR_START = Timestamp('2015-06-01', tz='UTC')
|
||||
# Calendar is set to cover several half days, to check a case where half
|
||||
# days would be read out of order in cases of windows which spanned over
|
||||
# multiple half days.
|
||||
TEST_CALENDAR_START = Timestamp('2014-06-02', tz='UTC')
|
||||
TEST_CALENDAR_STOP = Timestamp('2015-12-31', tz='UTC')
|
||||
|
||||
|
||||
|
||||
@@ -695,7 +695,7 @@ class BcolzMinuteBarReader(object):
|
||||
intervals = itree[start_idx:end_idx]
|
||||
for interval in intervals:
|
||||
ranges.append(interval.data)
|
||||
return ranges
|
||||
return sorted(ranges)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user