mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-08-07 20:17:45 +00:00
5baed909e7
* refactor: Update type annotations and remove unused class in evolving modules * refactor: Simplify evolving agent and feedback handling in CoSTEER module * lint & CI * mypy * ruff for core * mypy * refactor: remove unnecessary comments and update feedback handling logic * refactor: Add prev_task_feedback parameter to evolving strategies * feat: Clear folder before extracting zip file in DockerEnv * fix: Correct retrieval of last experiment from history
36 lines
1.2 KiB
Python
36 lines
1.2 KiB
Python
import re
|
|
from typing import Literal
|
|
|
|
import pandas as pd
|
|
|
|
from rdagent.core.experiment import Experiment, FBWorkspace, Task
|
|
|
|
COMPONENT = Literal["DataLoadSpec", "FeatureEng", "Model", "Ensemble", "Workflow"]
|
|
|
|
|
|
class DSExperiment(Experiment[Task, FBWorkspace, FBWorkspace]):
|
|
def __init__(self, pending_tasks_list: list, *args, **kwargs) -> None:
|
|
super().__init__(sub_tasks=[], *args, **kwargs)
|
|
# Status
|
|
# - Initial: blank;
|
|
# - Injecting from SOTA code;
|
|
# - New version no matter successful or not
|
|
# the initial workspace or the successful new version after coding
|
|
self.experiment_workspace = FBWorkspace()
|
|
self.pending_tasks_list = pending_tasks_list
|
|
self.format_check_result = None
|
|
|
|
def next_component_required(self) -> COMPONENT | None:
|
|
files = list(self.experiment_workspace.file_dict.keys())
|
|
if "load_data.py" not in files:
|
|
return "DataLoadSpec"
|
|
if "feature.py" not in files:
|
|
return "FeatureEng"
|
|
if not any(re.match(r"model.*\.py", file) for file in files):
|
|
return "Model"
|
|
if "ensemble.py" not in files:
|
|
return "Ensemble"
|
|
if "main.py" not in files:
|
|
return "Workflow"
|
|
return None
|