fix by review

This commit is contained in:
moririn2528
2023-09-15 14:56:42 +09:00
parent eb6234eabc
commit 29fa96d3eb
5 changed files with 7 additions and 9 deletions
+2 -4
View File
@@ -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,
+1 -1
View File
@@ -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()
+2 -2
View File
@@ -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) =>
+1 -1
View File
@@ -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 = {