Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Porting optuna-dashboard patches to Goptuna. #225

Merged
merged 2 commits into from
Apr 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dashboard/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM node:14.15.4 AS front-builder

RUN mkdir -p /usr/src/
RUN mkdir -p /usr/src/public/
WORKDIR /usr/src

ADD ./package.json /usr/src/package.json
Expand Down
4 changes: 2 additions & 2 deletions dashboard/src/components/DataGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ interface DataGridColumn<T> {
field: keyof T
label: string
sortable?: boolean
less?: (i: number, j: number) => number
less?: (a: T, b: T) => number
filterable?: boolean
toCellValue?: (rowIndex: number) => string | React.ReactNode
padding?: "default" | "checkbox" | "none"
Expand Down Expand Up @@ -342,7 +342,7 @@ function stableSort<T>(
const stabilizedThis = array.map((el, index) => [el, index] as [T, number])
stabilizedThis.sort((a, b) => {
if (less) {
const result = order == "asc" ? -less(a[1], b[1]) : less(a[1], b[1])
const result = order == "asc" ? -less(a[0], b[0]) : less(a[0], b[0])
if (result !== 0) return result
} else {
const result = comparator(a[0], b[0])
Expand Down
10 changes: 5 additions & 5 deletions dashboard/src/components/StudyDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,15 @@ const TrialTable: FC<{ trials: Trial[] }> = ({ trials = [] }) => {
return null
},
sortable: true,
less: (i, j): number => {
const firstStartMs = trials[i].datetime_start?.getTime()
const firstCompleteMs = trials[i].datetime_complete?.getTime()
less: (firstEl, secondEl): number => {
const firstStartMs = firstEl.datetime_start?.getTime()
const firstCompleteMs = firstEl.datetime_complete?.getTime()
const firstDurationMs =
firstStartMs !== undefined && firstCompleteMs !== undefined
? firstCompleteMs - firstStartMs
: undefined
const secondStartMs = trials[j].datetime_start?.getTime()
const secondCompleteMs = trials[j].datetime_complete?.getTime()
const secondStartMs = secondEl.datetime_start?.getTime()
const secondCompleteMs = secondEl.datetime_complete?.getTime()
const secondDurationMs =
secondStartMs !== undefined && secondCompleteMs !== undefined
? secondCompleteMs - secondStartMs
Expand Down
2 changes: 1 addition & 1 deletion dashboard/statik/statik.go

Large diffs are not rendered by default.