Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix shared task dict BUG #549

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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