mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-21 13:10:53 +08:00
fix by review
This commit is contained in:
@@ -221,10 +221,8 @@ def create_app(
|
||||
) = get_cached_extra_study_property(study_id, trials)
|
||||
|
||||
plotly_graph_objects = get_plotly_graph_objects(system_attrs)
|
||||
trials_id2number = {trial._trial_id: trial.number for trial in trials}
|
||||
skipped_trials = [
|
||||
trials_id2number[trial_id] for trial_id in get_skipped_trial_ids(system_attrs)
|
||||
]
|
||||
skipped_trial_ids = get_skipped_trial_ids(system_attrs)
|
||||
skipped_trials = [t.number for t in trials if t._trial_id in skipped_trial_ids]
|
||||
return serialize_study_detail(
|
||||
summary,
|
||||
best_trials,
|
||||
|
||||
@@ -167,7 +167,7 @@ def serialize_study_detail(
|
||||
if serialized["is_preferential"]:
|
||||
serialized["preference_history"] = serialize_preference_history(system_attrs)
|
||||
serialized["preferences"] = get_preferences(system_attrs)
|
||||
serialized["skipped_trials"] = skipped_trials
|
||||
serialized["skipped_trial_numbers"] = skipped_trials
|
||||
serialized["plotly_graph_objects"] = [
|
||||
{"id": id_, "graph_object": graph_object}
|
||||
for id_, graph_object in plotly_graph_objects.items()
|
||||
|
||||
@@ -99,7 +99,7 @@ interface StudyDetailResponse {
|
||||
preferences?: [number, number][]
|
||||
preference_history?: PreferenceHistoryResponce[]
|
||||
plotly_graph_objects: PlotlyGraphObject[]
|
||||
skipped_trials?: number[]
|
||||
skipped_trial_numbers?: number[]
|
||||
}
|
||||
|
||||
export const getStudyDetailAPI = (
|
||||
@@ -140,7 +140,7 @@ export const getStudyDetailAPI = (
|
||||
convertPreferenceHistory
|
||||
),
|
||||
plotly_graph_objects: res.data.plotly_graph_objects,
|
||||
skipped_trials: res.data.skipped_trials ?? [],
|
||||
skipped_trial_numbers: res.data.skipped_trial_numbers ?? [],
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ export const PreferentialTrials: FC<{ studyDetail: StudyDetail | null }> = ({
|
||||
studyDetail.preference_history
|
||||
?.filter((h) => !h.is_removed)
|
||||
.map((p) => p.clicked)
|
||||
.concat(studyDetail.skipped_trials) ?? []
|
||||
.concat(studyDetail.skipped_trial_numbers) ?? []
|
||||
)
|
||||
const activeTrials = studyDetail.trials.filter(
|
||||
(t) =>
|
||||
|
||||
Vendored
+1
-1
@@ -206,7 +206,7 @@ type StudyDetail = {
|
||||
preferences?: [number, number][]
|
||||
preference_history?: PreferenceHistory[]
|
||||
plotly_graph_objects: PlotlyGraphObject[]
|
||||
skipped_trials: number[]
|
||||
skipped_trial_numbers: number[]
|
||||
}
|
||||
|
||||
type StudyDetails = {
|
||||
|
||||
Reference in New Issue
Block a user