1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-11 14:56:55 +08:00

Add DataPathManager to QlibConfig && modify inst_processors to supports list only

This commit is contained in:
zhupr
2021-09-02 11:45:37 +08:00
committed by you-n-g
parent 707399a245
commit e84cc23589
10 changed files with 148 additions and 179 deletions

View File

@@ -35,7 +35,7 @@ def get_benchmark_weight(
"""
if not path:
path = Path(C.get_data_path(freq)).expanduser() / "raw" / "AIndexMembers" / "weights.csv"
path = Path(C.dpm.get_data_path(freq)).expanduser() / "raw" / "AIndexMembers" / "weights.csv"
# TODO: the storage of weights should be implemented in a more elegent way
# TODO: The benchmark is not consistant with the filename in instruments.
bench_weight_df = pd.read_csv(path, usecols=["code", "date", "index", "weight"])

View File

@@ -58,8 +58,7 @@ class Alpha360(DataHandlerLP):
fit_start_time=None,
fit_end_time=None,
filter_pipe=None,
sample_config=None,
sample_benchmark=None,
inst_processor=None,
**kwargs,
):
infer_processors = check_transform_proc(infer_processors, fit_start_time, fit_end_time)
@@ -74,8 +73,7 @@ class Alpha360(DataHandlerLP):
},
"filter_pipe": filter_pipe,
"freq": freq,
"sample_config": sample_config,
"sample_benchmark": sample_benchmark,
"inst_processor": inst_processor,
},
}
@@ -148,8 +146,7 @@ class Alpha158(DataHandlerLP):
fit_end_time=None,
process_type=DataHandlerLP.PTYPE_A,
filter_pipe=None,
sample_config=None,
sample_benchmark=None,
inst_processor=None,
**kwargs,
):
infer_processors = check_transform_proc(infer_processors, fit_start_time, fit_end_time)
@@ -164,8 +161,7 @@ class Alpha158(DataHandlerLP):
},
"filter_pipe": filter_pipe,
"freq": freq,
"sample_config": sample_config,
"sample_benchmark": sample_benchmark,
"inst_processor": inst_processor,
},
}
super().__init__(