mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-07 22:04:32 +08:00
BUG: Specify int64 instead of system int
to handle 32bit python
This commit is contained in:
@@ -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]'"
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user