Skip to content

Commit 0059a6a

Browse files
fix: remove refine decision & bug fix (#1031)
* remove refine decision & bug fix * code simpler * fix CI --------- Co-authored-by: Xu Yang <[email protected]>
1 parent 10246fd commit 0059a6a

File tree

5 files changed

+9
-116
lines changed

5 files changed

+9
-116
lines changed

rdagent/core/proposal.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,10 @@ def __init__(
5757
*,
5858
code_change_summary: str | None = None,
5959
decision: bool,
60-
refine_decision: bool = False,
6160
eda_improvement: str | None = None,
6261
exception: Exception | None = None,
6362
) -> None:
6463
self.decision = decision
65-
self.refine_decision = refine_decision
6664
self.eda_improvement = eda_improvement
6765
self.reason = reason
6866
# Exception is not None means failing to generate runnable experiments due to exception.
@@ -100,13 +98,11 @@ def __init__(
10098
*,
10199
code_change_summary: str | None = None,
102100
decision: bool,
103-
refine_decision: bool = False,
104101
eda_improvement: str | None = None,
105102
) -> None:
106103
super().__init__(
107104
reason,
108105
decision=decision,
109-
refine_decision=refine_decision,
110106
code_change_summary=code_change_summary,
111107
eda_improvement=eda_improvement,
112108
)

rdagent/scenarios/data_science/dev/feedback.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ def generate_feedback(self, exp: DSExperiment, trace: DSTrace) -> ExperimentFeed
102102
if evaluation_not_aligned
103103
else convert2bool(dict_get_with_warning(resp_dict, "Replace Best Result", "no"))
104104
),
105-
refine_decision=convert2bool(dict_get_with_warning(resp_dict, "Refine Decision", "no")),
106105
eda_improvement=dict_get_with_warning(resp_dict, "EDA Improvement", "no"), # EDA improvement suggestion
107106
)
108107

rdagent/scenarios/data_science/proposal/exp_gen/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def sota_experiment_fb(
226226
# the sota exp should be accepted decision and all required components are completed.
227227
if ef.decision:
228228
return exp, ef
229-
return None, None
229+
return None
230230

231231
def sota_experiment(
232232
self,

rdagent/scenarios/data_science/proposal/exp_gen/proposal.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from rdagent.scenarios.data_science.proposal.exp_gen.base import DSHypothesis, DSTrace
2222
from rdagent.scenarios.data_science.proposal.exp_gen.draft import DSDraftExpGen
2323
from rdagent.scenarios.data_science.proposal.exp_gen.idea_pool import DSIdea
24-
from rdagent.scenarios.data_science.proposal.exp_gen.refine import DSRefineExpGen
2524
from rdagent.utils.agent.tpl import T
2625
from rdagent.utils.repo.diff import generate_diff_from_dict
2726
from rdagent.utils.workflow import wait_retry
@@ -721,7 +720,7 @@ def task_gen(
721720
hypotheses: list[DSHypothesis],
722721
pipeline: bool,
723722
failed_exp_feedback_list_desc: str,
724-
sota_exp_fb: ExperimentFeedback | None = None,
723+
fb_to_sota_exp: ExperimentFeedback | None = None,
725724
) -> DSExperiment:
726725
if pipeline:
727726
component_info = get_component("Pipeline")
@@ -740,7 +739,7 @@ def task_gen(
740739
sota_exp_desc=sota_exp_desc,
741740
hypotheses=hypotheses,
742741
failed_exp_and_feedback_list_desc=failed_exp_feedback_list_desc,
743-
eda_improvement=sota_exp_fb.eda_improvement if sota_exp_fb else None,
742+
eda_improvement=fb_to_sota_exp.eda_improvement if fb_to_sota_exp else None,
744743
)
745744
response = APIBackend().build_messages_and_create_chat_completion(
746745
user_prompt=user_prompt,
@@ -824,7 +823,11 @@ def gen(
824823
]
825824
)
826825

827-
sota_exp, sota_exp_fb = trace.sota_experiment_fb()
826+
if sota_exp_fb := trace.sota_experiment_fb() is None:
827+
sota_exp, fb_to_sota_exp = None, None
828+
else:
829+
sota_exp, fb_to_sota_exp = sota_exp_fb
830+
828831
if not isinstance(sota_exp, DSExperiment):
829832
eda_output = None
830833
else:
@@ -922,5 +925,5 @@ def gen(
922925
),
923926
pipeline=pipeline,
924927
failed_exp_feedback_list_desc=failed_exp_feedback_list_desc,
925-
sota_exp_fb=sota_exp_fb,
928+
fb_to_sota_exp=fb_to_sota_exp,
926929
)

rdagent/scenarios/data_science/proposal/exp_gen/refine.py

Lines changed: 0 additions & 105 deletions
This file was deleted.

0 commit comments

Comments
 (0)