1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-06 20:41:09 +08:00
This commit is contained in:
bxdd
2021-06-01 18:50:50 +08:00
parent 04fff8ca36
commit 4d48c96d30
6 changed files with 96 additions and 109 deletions

View File

@@ -118,7 +118,8 @@ class BaseExecutor:
def get_report(self):
raise NotImplementedError("get_report is not implemented!")
def get_all_executor(self):
def get_all_executors(self):
"""Return all executors"""
return [self]
@@ -247,8 +248,9 @@ class NestedExecutor(BaseExecutor):
sub_env_report_dict.update({f"{_count}{_freq}": (_report, _positions)})
return sub_env_report_dict
def get_all_executor(self):
return [self, *self.inner_executor.get_all_executor()]
def get_all_executors(self):
"""Return all executors, including self and inner_executor.get_all_executors()"""
return [self, *self.inner_executor.get_all_executors()]
class SimulatorExecutor(BaseExecutor):

View File

@@ -12,6 +12,7 @@ from pandas.core.frame import DataFrame
from ..utils.resam import parse_freq, resam_ts_data
from ..data import D
from ..tests.config import CSI300_BENCH
class Report:
@@ -67,7 +68,7 @@ class Report:
self.bench = self._cal_benchmark(self.benchmark_config, self.freq)
def _cal_benchmark(self, benchmark_config, freq):
benchmark = benchmark_config.get("benchmark", "SH000300")
benchmark = benchmark_config.get("benchmark", CSI300_BENCH)
if isinstance(benchmark, pd.Series):
return benchmark
else: