diff --git a/qlib/workflow/task/utils.py b/qlib/workflow/task/utils.py index 4b4a7c06b8e..15a9c083a82 100644 --- a/qlib/workflow/task/utils.py +++ b/qlib/workflow/task/utils.py @@ -226,7 +226,7 @@ def truncate(self, segment: tuple, test_start, days: int) -> tuple: new_seg = [] for time_point in segment: tp_idx = min(self.align_idx(time_point), test_idx - days) - assert tp_idx > 0 + assert tp_idx >= 0 new_seg.append(self.get(tp_idx)) return tuple(new_seg) else: