Skip to content

Commit f3101ca

Browse files
committed
Fix bundle HDF5 compression option propagation
1 parent 25d13ce commit f3101ca

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

rqalpha/data/bundle.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,7 @@ def __init__(self, func, *args, **kwargs):
343343
self._step = 100
344344

345345
@property
346-
def total_steps(self):
347-
# type: () -> int
346+
def total_steps(self) -> int:
348347
return self._step
349348

350349
def __call__(self):
@@ -367,8 +366,7 @@ def __init__(self, order_book_ids, file_path: str, fields: List[str], market="cn
367366
self._market = market
368367

369368
@property
370-
def total_steps(self):
371-
# type: () -> int
369+
def total_steps(self) -> int:
372370
return len(self._order_book_ids)
373371

374372
def __call__(self):
@@ -513,9 +511,8 @@ def gather_tasks(path: str, create: bool, enable_compression: bool, **h5_kwargs)
513511
gen_instruments, gen_trading_dates, gen_st_days,
514512
gen_suspended_days, gen_yield_curve, gen_share_transformation, gen_future_info
515513
)
516-
kwargs = {}
517514
if enable_compression:
518-
kwargs['compression'] = 9
515+
h5_kwargs['compression'] = 9
519516
# windows上子进程需要执行rqdatac.init, 其他os则需要执行rqdatac.reset; rqdatac.init包含了rqdatac.reset的功能
520517
for file, order_book_id, field in day_bar_args:
521518
tasks.append(_DayBarTask(order_book_id, os.path.join(path, file), field, **h5_kwargs))

0 commit comments

Comments
 (0)