mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-15 00:36:55 +08:00
Update gen.py (#576)
This commit is contained in:
@@ -162,8 +162,7 @@ class RollingGen(TaskGen):
|
|||||||
List[dict]:
|
List[dict]:
|
||||||
the following tasks of `task`(`task` itself is excluded)
|
the following tasks of `task`(`task` itself is excluded)
|
||||||
"""
|
"""
|
||||||
t = copy.deepcopy(task)
|
prev_seg = task["dataset"]["kwargs"]["segments"]
|
||||||
prev_seg = t["dataset"]["kwargs"]["segments"]
|
|
||||||
while True:
|
while True:
|
||||||
segments = {}
|
segments = {}
|
||||||
try:
|
try:
|
||||||
@@ -184,6 +183,7 @@ class RollingGen(TaskGen):
|
|||||||
break
|
break
|
||||||
|
|
||||||
prev_seg = segments
|
prev_seg = segments
|
||||||
|
t = copy.deepcopy(task) # deepcopy is necessary to avoid modify task inplace
|
||||||
self._update_task_segs(t, segments)
|
self._update_task_segs(t, segments)
|
||||||
yield t
|
yield t
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user