mirror of
https://github.com/wassname/catalyst.git
synced 2026-09-12 12:12:04 +08:00
MAINT: Use coerce_string in BcolzDailyBarReader.
This commit is contained in:
@@ -23,6 +23,7 @@ import sqlite3
|
|||||||
from bcolz import (
|
from bcolz import (
|
||||||
carray,
|
carray,
|
||||||
ctable,
|
ctable,
|
||||||
|
open as open_ctable,
|
||||||
)
|
)
|
||||||
from click import progressbar
|
from click import progressbar
|
||||||
from numpy import (
|
from numpy import (
|
||||||
@@ -364,9 +365,8 @@ class BcolzDailyBarReader(object):
|
|||||||
We use calendar_offset and calendar to orient loaded blocks within a
|
We use calendar_offset and calendar to orient loaded blocks within a
|
||||||
range of queried dates.
|
range of queried dates.
|
||||||
"""
|
"""
|
||||||
|
@preprocess(table=coerce_string(open_ctable, mode='r'))
|
||||||
def __init__(self, table):
|
def __init__(self, table):
|
||||||
if isinstance(table, string_types):
|
|
||||||
table = ctable(rootdir=table, mode='r')
|
|
||||||
|
|
||||||
self._table = table
|
self._table = table
|
||||||
self._calendar = DatetimeIndex(table.attrs['calendar'], tz='UTC')
|
self._calendar = DatetimeIndex(table.attrs['calendar'], tz='UTC')
|
||||||
|
|||||||
Reference in New Issue
Block a user