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:
Eddie Hebert
2016-10-25 11:25:09 -04:00
parent fe90cd3177
commit 098d38ac76
3 changed files with 11 additions and 14 deletions
+2 -1
View File
@@ -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