From 84d2cb322625cbaf24ee0fd507308d03020b7a45 Mon Sep 17 00:00:00 2001 From: you-n-g Date: Wed, 25 Aug 2021 18:05:10 +0800 Subject: [PATCH] Update gen.py (#576) --- qlib/workflow/task/gen.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qlib/workflow/task/gen.py b/qlib/workflow/task/gen.py index e60fa4755..2fc87b1a4 100644 --- a/qlib/workflow/task/gen.py +++ b/qlib/workflow/task/gen.py @@ -162,8 +162,7 @@ class RollingGen(TaskGen): List[dict]: the following tasks of `task`(`task` itself is excluded) """ - t = copy.deepcopy(task) - prev_seg = t["dataset"]["kwargs"]["segments"] + prev_seg = task["dataset"]["kwargs"]["segments"] while True: segments = {} try: @@ -184,6 +183,7 @@ class RollingGen(TaskGen): break prev_seg = segments + t = copy.deepcopy(task) # deepcopy is necessary to avoid modify task inplace self._update_task_segs(t, segments) yield t