(self, **configs)
| 17 | |
| 18 | class CompositeTask(Task): |
| 19 | def __init__(self, **configs): |
| 20 | tasks = configs.pop("tasks", []) |
| 21 | self.tasks: List[Task] = [] |
| 22 | super().__init__(**configs) |
| 23 | for task in tasks: |
| 24 | assert "src" in task |
| 25 | if self.workers: |
| 26 | task.update({"workers": self.workers}) |
| 27 | src = os.path.join(os.path.dirname(configs["src"]), task.pop("src")) |
| 28 | sub_task = YAMLConfig.create_from_yaml(src, task) |
| 29 | sub_task.get_output_dir = (lambda s: (lambda: self._sub_output_dir(s)))(sub_task) |
| 30 | self.tasks.append(sub_task) |
| 31 | |
| 32 | def evaluate(self, agent: Agent) -> Dict[str, Dict[str, Any]]: |
| 33 | print(f"Evaluating Composite Task '{self.name}' ...") |
nothing calls this directly
no test coverage detected