TST: Use sum for volume on daily data resample.

Change the mock minute data to no longer use an increasing arange, so
that a days worth of minute data can be summed and fit inside of a
uint32.

This change was required because of working on new test data that looked
like [0, 100, 200, 0, ] which was resulting in a daily rollup of 0 data,
when the coverage needed a non-0 value.

Also, factor out the resampling function, with an eye on a making it
easier to convert from minute bars to daily bars during ingest/load
processes.
This commit is contained in:
Eddie Hebert
2016-08-05 14:24:14 -04:00
parent d2cab0668f
commit dd2c7db22d
4 changed files with 56 additions and 31 deletions
+4 -4
View File
@@ -1208,8 +1208,8 @@ class MinuteEquityHistoryTestCase(WithHistory, ZiplineTestCase):
self.assertEqual(window[0], 391)
self.assertEqual(window[1], 781)
elif field == 'volume':
self.assertEqual(window[0], 39100)
self.assertEqual(window[1], 78100)
self.assertEqual(window[0], 7663500)
self.assertEqual(window[1], 22873500)
last_val = -1
@@ -1274,8 +1274,8 @@ class MinuteEquityHistoryTestCase(WithHistory, ZiplineTestCase):
self.assertEqual(window[0], 781)
self.assertEqual(window[1], 1171)
elif field == 'volume':
self.assertEqual(window[0], 78100)
self.assertEqual(window[1], 117100)
self.assertEqual(window[0], 22873500)
self.assertEqual(window[1], 38083500)
last_val = -1