1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-10 06:20:57 +08:00

support multi-freq uri

This commit is contained in:
zhupr
2021-08-29 16:21:37 +08:00
committed by you-n-g
parent 6011a21308
commit d1cbf4c3d9
6 changed files with 213 additions and 200 deletions

View File

@@ -43,8 +43,9 @@ def get_redis_connection():
#################### Data ####################
def read_bin(file_path, start_index, end_index):
with open(file_path, "rb") as f:
def read_bin(file_path: Union[str, Path], start_index, end_index):
file_path = Path(file_path.expanduser().resolve())
with file_path.open("rb") as f:
# read start_index
ref_start_index = int(np.frombuffer(f.read(4), dtype="<f")[0])
si = max(ref_start_index, start_index)