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:
Eddie Hebert
2016-04-12 14:00:02 -04:00
parent 9561073c9d
commit d27f85e16b
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -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')
+1 -1
View File
@@ -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