Skip to content

Commit

Permalink
Update gen.py (microsoft#576)
Browse files Browse the repository at this point in the history
  • Loading branch information
you-n-g authored Aug 25, 2021
1 parent b7bcd44 commit 5d95d54
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qlib/workflow/task/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,7 @@ def gen_following_tasks(self, task: dict, test_end: pd.Timestamp) -> List[dict]:
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:
Expand All @@ -184,6 +183,7 @@ def gen_following_tasks(self, task: dict, test_end: pd.Timestamp) -> List[dict]:
break

prev_seg = segments
t = copy.deepcopy(task) # deepcopy is necessary to avoid modify task inplace
self._update_task_segs(t, segments)
yield t

Expand Down

0 comments on commit 5d95d54

Please sign in to comment.