mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-24 13:41:07 +08:00
Fix textfiled setting
This commit is contained in:
@@ -443,7 +443,7 @@ def create_app(storage: BaseStorage, debug: bool = False) -> Bottle:
|
||||
study = optuna.load_study(storage=storage, study_name=study_name)
|
||||
|
||||
try:
|
||||
study.tell(trial_id, values=values, state=state)
|
||||
study._storage.set_trial_state_values(trial_id, state, values)
|
||||
except Exception as e:
|
||||
response.status = 400 # Bad request
|
||||
return {"reason": e.args}
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import React, {
|
||||
ChangeEvent,
|
||||
createRef,
|
||||
FC,
|
||||
FormEvent,
|
||||
MouseEvent,
|
||||
useState,
|
||||
} from "react"
|
||||
import {
|
||||
Typography,
|
||||
@@ -293,9 +291,8 @@ export const TrialTable: FC<{
|
||||
const studyId = (studyDetail as StudyDetail).id
|
||||
const trialId = trials[index].number
|
||||
const objectiveValues = objectiveFormRefs.map((ref) =>
|
||||
ref.current ? ref.current.value : ""
|
||||
ref.current ? Number(ref.current.value) : NaN
|
||||
)
|
||||
console.dir(objectiveValues)
|
||||
action.tellTrial(studyId, trialId, "Complete", objectiveValues)
|
||||
}
|
||||
const handleFailTrial = (e: MouseEvent<HTMLButtonElement>): void => {
|
||||
@@ -346,6 +343,7 @@ export const TrialTable: FC<{
|
||||
{objectiveFormRefs !== undefined &&
|
||||
objectiveFormRefs.map((ref, i) => (
|
||||
<TextField
|
||||
required
|
||||
id={`objective-${i}`}
|
||||
key={`objective-${i}`}
|
||||
label={
|
||||
@@ -354,8 +352,7 @@ export const TrialTable: FC<{
|
||||
? objectiveNames[i]
|
||||
: `Objective ${i}`
|
||||
}
|
||||
type="text"
|
||||
pattern="^([1-9]\d*|0)(\.\d+)?$"
|
||||
inputProps={{ inputMode: 'numeric', pattern: '[+-]?([0-9]+(.[0-9]*)?|.[0-9]+)([eE][+-]?[0-9]+)?', title: "Please input a float number"}}
|
||||
inputRef={ref}
|
||||
/>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user