mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-11 11:16:15 +08:00
MAINT: Return nan from daily bcolz get_value.
Match the behavior of the minute bar reader, now that the session and minute bar readers share a common interface. isnull is slightly slower than checking against -1; however, n cases where we check against illiquid trades in a tight loop, volume is checked which is not using nan. The change here should be marginal with regards to performance.
This commit is contained in:
@@ -18,6 +18,7 @@ from nose_parameterized import parameterized
|
||||
from numpy import (
|
||||
arange,
|
||||
datetime64,
|
||||
nan,
|
||||
)
|
||||
from numpy.testing import (
|
||||
assert_array_equal,
|
||||
@@ -340,7 +341,7 @@ class BcolzDailyBarTestCase(WithBcolzEquityDailyBarReader, ZiplineTestCase):
|
||||
reader._spot_col('close')[zero_ix] = 0
|
||||
|
||||
close = reader.get_value(zero_sid, zero_day, 'close')
|
||||
self.assertEqual(-1, close)
|
||||
assert_array_equal(nan, close)
|
||||
finally:
|
||||
reader._spot_col('close')[zero_ix] = old
|
||||
|
||||
|
||||
Reference in New Issue
Block a user