1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-05 03:50:57 +08:00

online debug

This commit is contained in:
lzh222333
2021-03-30 06:56:04 +00:00
parent ee45a7833e
commit 1f2d2c9b69
2 changed files with 5 additions and 4 deletions

View File

@@ -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):

View File

@@ -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")