mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-18 12:20:12 +08:00
BUG: Fixing bitness issues on 32-bit systems
by being explicit with sizes
This commit is contained in:
@@ -1131,15 +1131,15 @@ class TestBeforeTradingStart(TestCase):
|
||||
# Mergers and Dividends are not tested, but we need to have these
|
||||
# anyway
|
||||
mergers = pd.DataFrame({}, columns=['effective_date', 'ratio', 'sid'])
|
||||
mergers.effective_date = mergers.effective_date.astype(int)
|
||||
mergers.ratio = mergers.ratio.astype(float)
|
||||
mergers.sid = mergers.sid.astype(int)
|
||||
mergers.effective_date = mergers.effective_date.astype(np.int64)
|
||||
mergers.ratio = mergers.ratio.astype(np.float64)
|
||||
mergers.sid = mergers.sid.astype(np.int64)
|
||||
|
||||
dividends = pd.DataFrame({}, columns=['ex_date', 'record_date',
|
||||
'declared_date', 'pay_date',
|
||||
'amount', 'sid'])
|
||||
dividends.amount = dividends.amount.astype(float)
|
||||
dividends.sid = dividends.sid.astype(int)
|
||||
dividends.amount = dividends.amount.astype(np.float64)
|
||||
dividends.sid = dividends.sid.astype(np.int64)
|
||||
|
||||
adj_writer.write(splits, mergers, dividends)
|
||||
|
||||
|
||||
@@ -203,15 +203,15 @@ class TestAPIShim(TestCase):
|
||||
# Mergers and Dividends are not tested, but we need to have these
|
||||
# anyway
|
||||
mergers = pd.DataFrame({}, columns=['effective_date', 'ratio', 'sid'])
|
||||
mergers.effective_date = mergers.effective_date.astype(int)
|
||||
mergers.ratio = mergers.ratio.astype(float)
|
||||
mergers.sid = mergers.sid.astype(int)
|
||||
mergers.effective_date = mergers.effective_date.astype(np.int64)
|
||||
mergers.ratio = mergers.ratio.astype(np.float64)
|
||||
mergers.sid = mergers.sid.astype(np.int64)
|
||||
|
||||
dividends = pd.DataFrame({}, columns=['ex_date', 'record_date',
|
||||
'declared_date', 'pay_date',
|
||||
'amount', 'sid'])
|
||||
dividends.amount = dividends.amount.astype(float)
|
||||
dividends.sid = dividends.sid.astype(int)
|
||||
dividends.amount = dividends.amount.astype(np.float64)
|
||||
dividends.sid = dividends.sid.astype(np.int64)
|
||||
|
||||
adj_writer.write(splits, mergers, dividends)
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from numpy import (
|
||||
float64,
|
||||
uint32
|
||||
uint32,
|
||||
int64,
|
||||
)
|
||||
from bcolz import ctable
|
||||
|
||||
@@ -37,8 +38,9 @@ class DailyBarWriterFromDataFrames(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):
|
||||
|
||||
Reference in New Issue
Block a user