mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-10 12:23:22 +08:00
Merge pull request #550 from c-bata/remove-system-attrs-from-api-response
Remove `system_attrs` attributes from API response
This commit is contained in:
@@ -107,7 +107,6 @@ def serialize_study_summary(summary: StudySummary) -> dict[str, Any]:
|
||||
"study_name": summary.study_name,
|
||||
"directions": [d.name.lower() for d in summary.directions],
|
||||
"user_attrs": serialize_attrs(summary.user_attrs),
|
||||
"system_attrs": serialize_attrs(getattr(summary, "system_attrs", {})),
|
||||
}
|
||||
|
||||
if summary.datetime_start is not None:
|
||||
@@ -183,9 +182,6 @@ def serialize_frozen_trial(
|
||||
for param_name in fixed_params
|
||||
],
|
||||
"user_attrs": serialize_attrs(trial.user_attrs),
|
||||
"system_attrs": serialize_attrs(
|
||||
{k: trial_system_attrs[k] for k in trial_system_attrs if not k.startswith("dashboard")}
|
||||
),
|
||||
"note": note.get_note_from_system_attrs(study_system_attrs, trial._trial_id),
|
||||
"artifacts": list_trial_artifacts(study_system_attrs, trial),
|
||||
"constraints": trial_system_attrs.get(CONSTRAINTS_KEY, []),
|
||||
|
||||
@@ -27,7 +27,6 @@ interface TrialResponse {
|
||||
param_external_value: string
|
||||
}[]
|
||||
user_attrs: Attribute[]
|
||||
system_attrs: Attribute[]
|
||||
note: Note
|
||||
artifacts: Artifact[]
|
||||
constraints: number[]
|
||||
@@ -50,7 +49,6 @@ const convertTrialResponse = (res: TrialResponse): Trial => {
|
||||
params: res.params,
|
||||
fixed_params: res.fixed_params,
|
||||
user_attrs: res.user_attrs,
|
||||
system_attrs: res.system_attrs,
|
||||
note: res.note,
|
||||
artifacts: res.artifacts,
|
||||
constraints: res.constraints,
|
||||
@@ -113,7 +111,6 @@ interface StudySummariesResponse {
|
||||
study_name: string
|
||||
directions: StudyDirection[]
|
||||
user_attrs: Attribute[]
|
||||
system_attrs: Attribute[]
|
||||
datetime_start?: string
|
||||
}[]
|
||||
}
|
||||
@@ -128,7 +125,6 @@ export const getStudySummariesAPI = (): Promise<StudySummary[]> => {
|
||||
study_name: study.study_name,
|
||||
directions: study.directions,
|
||||
user_attrs: study.user_attrs,
|
||||
system_attrs: study.system_attrs,
|
||||
datetime_start: study.datetime_start
|
||||
? new Date(study.datetime_start)
|
||||
: undefined,
|
||||
@@ -143,7 +139,6 @@ interface CreateNewStudyResponse {
|
||||
study_name: string
|
||||
directions: StudyDirection[]
|
||||
user_attrs: Attribute[]
|
||||
system_attrs: Attribute[]
|
||||
datetime_start?: string
|
||||
}
|
||||
}
|
||||
@@ -165,7 +160,6 @@ export const createNewStudyAPI = (
|
||||
directions: study_summary.directions,
|
||||
// best_trial: undefined,
|
||||
user_attrs: study_summary.user_attrs,
|
||||
system_attrs: study_summary.system_attrs,
|
||||
datetime_start: study_summary.datetime_start
|
||||
? new Date(study_summary.datetime_start)
|
||||
: undefined,
|
||||
@@ -184,7 +178,6 @@ type RenameStudyResponse = {
|
||||
study_name: string
|
||||
directions: StudyDirection[]
|
||||
user_attrs: Attribute[]
|
||||
system_attrs: Attribute[]
|
||||
datetime_start?: string
|
||||
}
|
||||
|
||||
@@ -202,7 +195,6 @@ export const renameStudyAPI = (
|
||||
study_name: res.data.study_name,
|
||||
directions: res.data.directions,
|
||||
user_attrs: res.data.user_attrs,
|
||||
system_attrs: res.data.system_attrs,
|
||||
datetime_start: res.data.datetime_start
|
||||
? new Date(res.data.datetime_start)
|
||||
: undefined,
|
||||
|
||||
Vendored
-2
@@ -111,7 +111,6 @@ type Trial = {
|
||||
param_external_value: string
|
||||
}[]
|
||||
user_attrs: Attribute[]
|
||||
system_attrs: Attribute[]
|
||||
constraints: number[]
|
||||
note: Note
|
||||
artifacts: Artifact[]
|
||||
@@ -122,7 +121,6 @@ type StudySummary = {
|
||||
study_name: string
|
||||
directions: StudyDirection[]
|
||||
user_attrs: Attribute[]
|
||||
system_attrs: Attribute[]
|
||||
datetime_start?: Date
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user