mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-07-27 23:47:46 +00:00
feat: add last_exp_fb to DSTrace and update feedback retrieval usage (#910)
* feat: add last_exp_fb to DSTrace and update feedback retrieval usage * fix: use trace.last_exp_fb for previous trial feedback description
This commit is contained in:
@@ -31,11 +31,9 @@ class DSExperiment2Feedback(Experiment2Feedback):
|
||||
exp=sota_exp, heading="SOTA of previous exploration of the scenario"
|
||||
)
|
||||
|
||||
last_exp = trace.last_exp()
|
||||
|
||||
# Get feedback description using shared template
|
||||
feedback_desc = T("scenarios.data_science.share:describe.feedback").r(
|
||||
exp_and_feedback=trace.hist[-1] if trace.hist else None, heading="Previous Trial Feedback"
|
||||
exp_and_feedback=trace.last_exp_fb(), heading="Previous Trial Feedback"
|
||||
)
|
||||
|
||||
# TODO:
|
||||
|
||||
@@ -304,10 +304,20 @@ class DSTrace(Trace[DataScienceScen, KnowledgeBase]):
|
||||
"""
|
||||
Access the last experiment
|
||||
"""
|
||||
search_list = self.retrieve_search_list(search_type)
|
||||
if (last_exp_fb := self.last_exp_fb(search_type=search_type)) is not None:
|
||||
return last_exp_fb[0]
|
||||
return None
|
||||
|
||||
def last_exp_fb(
|
||||
self,
|
||||
search_type: Literal["all", "ancestors"] = "ancestors",
|
||||
) -> tuple[DSExperiment, ExperimentFeedback] | None:
|
||||
"""
|
||||
Access the last experiment and feedback
|
||||
"""
|
||||
search_list = self.retrieve_search_list(search_type)
|
||||
for exp, ef in search_list[::-1]:
|
||||
return exp
|
||||
return exp, ef
|
||||
return None
|
||||
|
||||
def last_runnable_exp_fb(
|
||||
|
||||
Reference in New Issue
Block a user