BUG: Specify int64 instead of system int

to handle 32bit python
This commit is contained in:
Richard Frank
2016-03-05 16:22:42 -05:00
parent 0ac379eb74
commit d873038a7e
4 changed files with 8 additions and 5 deletions
+1 -1
View File
@@ -280,7 +280,7 @@ class PreprocessTestCase(TestCase):
self.assertIs(c_ret, good_c)
with self.assertRaises(TypeError) as e:
foo(good_a, arange(3), good_c)
foo(good_a, arange(3, dtype='int64'), good_c)
expected_message = (
"{qualname}() expected a value with dtype 'datetime64[ns]'"
+2 -1
View File
@@ -18,6 +18,7 @@ from cpython cimport (
)
from numpy import (
int64,
uint32,
zeros,
)
@@ -208,7 +209,7 @@ cpdef load_adjustments_from_sqlite(object adjustments_db, # sqlite3.Connection
dict col_adjustments
cdef ndarray[int64_t, ndim=1] _dates_seconds = \
dates.values.astype('datetime64[s]').view(int)
dates.values.astype('datetime64[s]').view(int64)
# Pre-populate date index cache.
for i, dt in enumerate(_dates_seconds):
+3 -2
View File
@@ -302,8 +302,9 @@ class DailyBarWriterFromCSVs(BcolzDailyBarWriter):
return array.astype(uint32)
elif colname == 'day':
nanos_per_second = (1000 * 1000 * 1000)
self.check_uint_safe(arrmax.view(int) / nanos_per_second, colname)
return (array.view(int) / nanos_per_second).astype(uint32)
self.check_uint_safe(arrmax.view(int64) / nanos_per_second,
colname)
return (array.view(int64) / nanos_per_second).astype(uint32)
@staticmethod
def check_uint_safe(value, colname):
+2 -1
View File
@@ -173,7 +173,8 @@ class SeededRandomLoader(PrecomputedLoader):
"""
Return uniformly-distributed integers between 0 and 100.
"""
return self.state.random_integers(low=0, high=100, size=shape)
return (self.state.random_integers(low=0, high=100, size=shape)
.astype('int64')) # default is system int
def _datetime_values(self, shape):
"""