滚动预测时可能的bug
我执行rolling_benchmark.py时,发生如下错误。
[11664:MainThread](2023-09-30 09:46:50,926) WARNING - qlib.data - [data.py:666] - load calendar error: freq=day, future=True; return current calendar!
[11664:MainThread](2023-09-30 09:46:50,927) WARNING - qlib.data - [data.py:669] - You can get future calendar by referring to the following document: https://github.com/microsoft/qlib/blob/main/scripts/data_collector/contrib/README.md
[11664:MainThread](2023-09-30 09:46:50,941) ERROR - qlib.workflow - [utils.py:41] - An exception has been raised[TypeError: '>' not supported between instances of 'NoneType' and 'Timestamp'].
File "g:/qlibtutor/advance/benchmarks_dynamic/baseline/my_rolling_benchmark.py", line 61, in
我把gen_following_tasks方法中的 if segments[self.test_key][0] > test_end:改为 if segments[self.test_key][0] is None or segments[self.test_key][0] > test_end:就正常了。不知这样改正确否。