[Mod] make flake8 happy
This commit is contained in:
parent
1074a26b77
commit
f797152bd5
@ -39,17 +39,17 @@ class CsvLoaderEngine(BaseEngine):
|
|||||||
""""""
|
""""""
|
||||||
super().__init__(main_engine, event_engine, APP_NAME)
|
super().__init__(main_engine, event_engine, APP_NAME)
|
||||||
|
|
||||||
self.file_path: str = ''
|
self.file_path: str = ""
|
||||||
|
|
||||||
self.symbol: str = ""
|
self.symbol: str = ""
|
||||||
self.exchange: Exchange = Exchange.SSE
|
self.exchange: Exchange = Exchange.SSE
|
||||||
self.interval: Interval = Interval.MINUTE
|
self.interval: Interval = Interval.MINUTE
|
||||||
self.datetime_head: str = ''
|
self.datetime_head: str = ""
|
||||||
self.open_head: str = ''
|
self.open_head: str = ""
|
||||||
self.close_head: str = ''
|
self.close_head: str = ""
|
||||||
self.low_head: str = ''
|
self.low_head: str = ""
|
||||||
self.high_head: str = ''
|
self.high_head: str = ""
|
||||||
self.volume_head: str = ''
|
self.volume_head: str = ""
|
||||||
|
|
||||||
def load_by_handle(
|
def load_by_handle(
|
||||||
self,
|
self,
|
||||||
@ -63,7 +63,7 @@ class CsvLoaderEngine(BaseEngine):
|
|||||||
low_head: str,
|
low_head: str,
|
||||||
high_head: str,
|
high_head: str,
|
||||||
volume_head: str,
|
volume_head: str,
|
||||||
datetime_format: str
|
datetime_format: str,
|
||||||
):
|
):
|
||||||
"""
|
"""
|
||||||
load by text mode file handle
|
load by text mode file handle
|
||||||
@ -78,17 +78,17 @@ class CsvLoaderEngine(BaseEngine):
|
|||||||
dt = datetime.strptime(item[datetime_head], datetime_format)
|
dt = datetime.strptime(item[datetime_head], datetime_format)
|
||||||
else:
|
else:
|
||||||
dt = datetime.fromisoformat(item[datetime_head])
|
dt = datetime.fromisoformat(item[datetime_head])
|
||||||
|
|
||||||
db_bar = DbBarData(
|
db_bar = DbBarData(
|
||||||
symbol=symbol,
|
symbol=symbol,
|
||||||
exchange=exchange.value,
|
exchange=exchange.value,
|
||||||
datetime=dt,
|
datetime=dt,
|
||||||
interval=interval.value,
|
interval=interval.value,
|
||||||
volume=item[volume_head],
|
volume=item[volume_head],
|
||||||
open_price=item[open_head],
|
open_price=item[open_head],
|
||||||
high_price=item[high_head],
|
high_price=item[high_head],
|
||||||
low_price=item[low_head],
|
low_price=item[low_head],
|
||||||
close_price=item[close_head],
|
close_price=item[close_head],
|
||||||
)
|
)
|
||||||
|
|
||||||
db_bars.append(db_bar)
|
db_bars.append(db_bar)
|
||||||
@ -116,12 +116,12 @@ class CsvLoaderEngine(BaseEngine):
|
|||||||
low_head: str,
|
low_head: str,
|
||||||
high_head: str,
|
high_head: str,
|
||||||
volume_head: str,
|
volume_head: str,
|
||||||
datetime_format: str
|
datetime_format: str,
|
||||||
):
|
):
|
||||||
"""
|
"""
|
||||||
load by filename
|
load by filename
|
||||||
"""
|
"""
|
||||||
with open(file_path, 'rt') as f:
|
with open(file_path, "rt") as f:
|
||||||
return self.load_by_handle(
|
return self.load_by_handle(
|
||||||
f,
|
f,
|
||||||
symbol=symbol,
|
symbol=symbol,
|
||||||
|
@ -1002,4 +1002,4 @@ def load_tick_data(
|
|||||||
.order_by(DbTickData.datetime)
|
.order_by(DbTickData.datetime)
|
||||||
)
|
)
|
||||||
data = [db_tick.db_tick() for db_tick in s]
|
data = [db_tick.db_tick() for db_tick in s]
|
||||||
return data
|
return data
|
||||||
|
Loading…
Reference in New Issue
Block a user