mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-19 12:00:15 +08:00
TST: fix data tests
This commit is contained in:
committed by
LotannaEzenwa
parent
ef4eafbbb8
commit
e8728c0cd4
@@ -212,7 +212,7 @@ cpdef _read_bcolz_data(ctable_t table,
|
||||
carray[first_row:last_row + 1]
|
||||
else:
|
||||
continue
|
||||
|
||||
|
||||
if column_name in {'open', 'high', 'low', 'close'}:
|
||||
where_nan = (outbuf == 0)
|
||||
outbuf_as_float = outbuf.astype(float64) * .001
|
||||
|
||||
@@ -356,10 +356,12 @@ def _make_bundle_core():
|
||||
asset_db_path(name, timestr, environ=environ),
|
||||
)).path,
|
||||
)
|
||||
wf = stack.enter_context(working_file(
|
||||
adjustment_db_path(name, timestr, environ=environ),
|
||||
))
|
||||
wf.close() # we need to close the file to delete it on windows
|
||||
adjustment_db_writer = SQLiteAdjustmentWriter(
|
||||
stack.enter_context(working_file(
|
||||
adjustment_db_path(name, timestr, environ=environ),
|
||||
)).path,
|
||||
wf.path,
|
||||
BcolzDailyBarReader(daily_bars_path),
|
||||
bundle.calendar,
|
||||
overwrite=True,
|
||||
|
||||
@@ -258,7 +258,10 @@ def gen_symbol_data(api_key,
|
||||
_update_splits(splits, asset_id, raw_data)
|
||||
_update_dividends(dividends, asset_id, raw_data)
|
||||
|
||||
raw_data = raw_data.reindex(calendar, copy=False).fillna(0.0)
|
||||
raw_data = raw_data.reindex(
|
||||
calendar.tz_localize(None),
|
||||
copy=False,
|
||||
).fillna(0.0)
|
||||
yield asset_id, raw_data
|
||||
|
||||
if should_sleep:
|
||||
|
||||
@@ -15,7 +15,6 @@ from abc import ABCMeta, abstractmethod, abstractproperty
|
||||
from errno import ENOENT
|
||||
from functools import partial
|
||||
from os import remove
|
||||
from os.path import exists
|
||||
import sqlite3
|
||||
import warnings
|
||||
|
||||
@@ -875,7 +874,7 @@ class SQLiteAdjustmentWriter(object):
|
||||
if isinstance(conn_or_path, sqlite3.Connection):
|
||||
self.conn = conn_or_path
|
||||
elif isinstance(conn_or_path, str):
|
||||
if overwrite and exists(conn_or_path):
|
||||
if overwrite:
|
||||
try:
|
||||
remove(conn_or_path)
|
||||
except OSError as e:
|
||||
|
||||
Reference in New Issue
Block a user