mirror of
https://github.com/wassname/catalyst.git
synced 2026-09-10 11:50:32 +08:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user