diff --git a/tests/utils/test_preprocess.py b/tests/utils/test_preprocess.py index 4f425b16..2626cedb 100644 --- a/tests/utils/test_preprocess.py +++ b/tests/utils/test_preprocess.py @@ -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]'" diff --git a/zipline/data/_adjustments.pyx b/zipline/data/_adjustments.pyx index b53474f2..5fded76b 100644 --- a/zipline/data/_adjustments.pyx +++ b/zipline/data/_adjustments.pyx @@ -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): diff --git a/zipline/data/us_equity_pricing.py b/zipline/data/us_equity_pricing.py index 6b15f013..8d508b9e 100644 --- a/zipline/data/us_equity_pricing.py +++ b/zipline/data/us_equity_pricing.py @@ -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): diff --git a/zipline/pipeline/loaders/synthetic.py b/zipline/pipeline/loaders/synthetic.py index 1d983a53..a212b2c0 100644 --- a/zipline/pipeline/loaders/synthetic.py +++ b/zipline/pipeline/loaders/synthetic.py @@ -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): """