diff --git a/qlib/workflow/task/gen.py b/qlib/workflow/task/gen.py index 1d363d7f1..c64939e82 100644 --- a/qlib/workflow/task/gen.py +++ b/qlib/workflow/task/gen.py @@ -36,14 +36,13 @@ def task_generator(tasks, generators) -> list: generators = [generators] # generate gen_task_list - gen_task_list = [] for gen in generators: new_task_list = [] for task in tasks: new_task_list.extend(gen.generate(task)) - gen_task_list = new_task_list + tasks = new_task_list - return gen_task_list + return tasks class TaskGen(metaclass=abc.ABCMeta): diff --git a/qlib/workflow/task/utils.py b/qlib/workflow/task/utils.py index 15123a291..29d7a495c 100644 --- a/qlib/workflow/task/utils.py +++ b/qlib/workflow/task/utils.py @@ -30,6 +30,7 @@ def get_mongodb(): client = MongoClient(cfg["task_url"]) return client.get_database(name=cfg["task_db_name"]) + def list_recorders(experiment, rec_filter_func=None): """list all recorders which can pass the filter in a experiment. @@ -50,6 +51,7 @@ def list_recorders(experiment, rec_filter_func=None): return recs_flt + class TimeAdjuster: """ find appropriate date and adjust date. @@ -146,7 +148,7 @@ class TimeAdjuster: """ if isinstance(segment, dict): return {k: self.align_seg(seg) for k, seg in segment.items()} - elif isinstance(segment, tuple): + elif isinstance(segment, tuple) or isinstance(segment, list): return self.align_time(segment[0], tp_type="start"), self.align_time(segment[1], tp_type="end") else: raise NotImplementedError(f"This type of input is not supported")