Skip to content

Commit

Permalink
fix: raise error in demo when no Metric in a Loop (#313)
Browse files Browse the repository at this point in the history
* fix webpage when Metric is None

* fix CI
  • Loading branch information
XianBW authored Sep 24, 2024
1 parent f8f59ff commit e46a78e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions rdagent/log/ui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,11 @@ def get_msgs_until(end_func: Callable[[Message], bool] = lambda _: True):
state.alpha158_metrics = sms

# common metrics
if msg.content.result is None and isinstance(state.scenario, DMModelScenario):
state.metric_series.append(pd.Series([None], index=["AUROC"], name=f"Round {state.lround}"))
if msg.content.result is None:
if isinstance(state.scenario, DMModelScenario):
state.metric_series.append(
pd.Series([None], index=["AUROC"], name=f"Round {state.lround}")
)
else:
sms = msg.content.result
if isinstance(state.scenario, DMModelScenario):
Expand All @@ -155,8 +158,7 @@ def get_msgs_until(end_func: Callable[[Message], bool] = lambda _: True):
state.scenario, (QlibModelScenario, QlibFactorFromReportScenario, QlibFactorScenario)
):
sms = sms.loc[QLIB_SELECTED_METRICS]
elif isinstance(state.scenario, KGScenario):
sms = sms.loc[["MCC"]]

sms.name = f"Round {state.lround}"
state.metric_series.append(sms)
elif "hypothesis generation" in tags:
Expand Down

0 comments on commit e46a78e

Please sign in to comment.