Skip to content

Commit

Permalink
fix: adjust types
Browse files Browse the repository at this point in the history
  • Loading branch information
keita-determined committed Oct 22, 2024
1 parent b9de7ed commit 4e3c1c6
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 25 deletions.
8 changes: 4 additions & 4 deletions webui/react/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion webui/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"fp-ts": "^2.16.5",
"fuse.js": "^7.0.0",
"hermes-parallel-coordinates": "^0.6.17",
"hew": "npm:@hpe.com/hew@^0.6.51",
"hew": "npm:@hpe.com/hew@^0.6.52",
"humanize-duration": "^3.28.0",
"immutable": "^4.3.0",
"io-ts": "^2.2.21",
Expand Down
13 changes: 6 additions & 7 deletions webui/react/src/components/Searches/columns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ export const getColumnDefs = ({
},
checkpointCount: {
id: 'checkpointCount',
isNumerical: true,
renderer: (record: ExperimentWithTrial) => ({
allowOverlay: false,
data: Number(record.experiment.checkpoints),
Expand All @@ -139,11 +138,11 @@ export const getColumnDefs = ({
}),
title: 'Checkpoints',
tooltip: () => undefined,
type: 'number',
width: columnWidths.checkpointCount,
},
checkpointSize: {
id: 'checkpointSize',
isNumerical: true,
renderer: (record: ExperimentWithTrial) =>
handleEmptyCell(record.experiment.checkpointSize, (data) => ({
allowOverlay: false,
Expand All @@ -153,6 +152,7 @@ export const getColumnDefs = ({
})),
title: 'Checkpoint Size',
tooltip: () => undefined,
type: 'number',
width: columnWidths.checkpointSize,
},
description: {
Expand All @@ -174,7 +174,6 @@ export const getColumnDefs = ({
},
duration: {
id: 'duration',
isNumerical: true,
renderer: (record: ExperimentWithTrial) =>
handleEmptyCell(record.experiment.duration, () => ({
allowOverlay: false,
Expand All @@ -184,6 +183,7 @@ export const getColumnDefs = ({
})),
title: 'Duration',
tooltip: () => undefined,
type: 'number',
width: columnWidths.duration,
},
externalExperimentId: {
Expand Down Expand Up @@ -297,7 +297,6 @@ export const getColumnDefs = ({
},
numTrials: {
id: 'numTrials',
isNumerical: true,
renderer: (record: ExperimentWithTrial) => ({
allowOverlay: false,
data: record.experiment.numTrials,
Expand All @@ -306,6 +305,7 @@ export const getColumnDefs = ({
}),
title: 'Runs',
tooltip: () => undefined,
type: 'number',
width: columnWidths.numTrials,
},
progress: {
Expand Down Expand Up @@ -335,7 +335,6 @@ export const getColumnDefs = ({
},
searcherMetric: {
id: 'searcherMetric',
isNumerical: false,
renderer: (record: ExperimentWithTrial) =>
handleEmptyCell(record.experiment.searcherMetric, (data) => ({
allowOverlay: false,
Expand All @@ -361,7 +360,6 @@ export const getColumnDefs = ({
},
startTime: {
id: 'startTime',
isNumerical: true,
renderer: (record: ExperimentWithTrial) => ({
allowOverlay: false,
copyData: getTimeInEnglish(new Date(record.experiment.startTime)),
Expand All @@ -370,6 +368,7 @@ export const getColumnDefs = ({
}),
title: 'Start Time',
tooltip: () => undefined,
type: 'number',
width: columnWidths.startTime,
},
state: {
Expand Down Expand Up @@ -440,7 +439,6 @@ export const getColumnDefs = ({
export const searcherMetricsValColumn = (columnWidth?: number): ColumnDef<ExperimentWithTrial> => {
return {
id: 'searcherMetricsVal',
isNumerical: true,
renderer: (record: ExperimentWithTrial) =>
handleEmptyCell(record.bestTrial?.searcherMetricsVal, (data) => ({
allowOverlay: false,
Expand All @@ -450,6 +448,7 @@ export const searcherMetricsValColumn = (columnWidth?: number): ColumnDef<Experi
})),
title: 'Searcher Metric Value',
tooltip: () => undefined,
type: 'number',
width: columnWidth ?? DEFAULT_COLUMN_WIDTH,
};
};
Expand Down
13 changes: 6 additions & 7 deletions webui/react/src/pages/F_ExpList/expListColumns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ export const getColumnDefs = ({
},
checkpointCount: {
id: 'checkpointCount',
isNumerical: true,
renderer: (record: ExperimentWithTrial) => ({
allowOverlay: false,
data: Number(record.experiment.checkpoints),
Expand All @@ -145,11 +144,11 @@ export const getColumnDefs = ({
}),
title: 'Checkpoints',
tooltip: () => undefined,
type: 'number',
width: columnWidths.checkpointCount ?? defaultColumnWidths.checkpointCount ?? MIN_COLUMN_WIDTH,
},
checkpointSize: {
id: 'checkpointSize',
isNumerical: true,
renderer: (record: ExperimentWithTrial) => ({
allowOverlay: false,
copyData: record.experiment.checkpointSize
Expand All @@ -160,6 +159,7 @@ export const getColumnDefs = ({
}),
title: 'Checkpoint Size',
tooltip: () => undefined,
type: 'number',
width: columnWidths.checkpointSize ?? defaultColumnWidths.checkpointSize ?? MIN_COLUMN_WIDTH,
},
description: {
Expand All @@ -176,7 +176,6 @@ export const getColumnDefs = ({
},
duration: {
id: 'duration',
isNumerical: true,
renderer: (record: ExperimentWithTrial) => ({
allowOverlay: false,
copyData: getDurationInEnglish(record.experiment),
Expand All @@ -185,6 +184,7 @@ export const getColumnDefs = ({
}),
title: 'Duration',
tooltip: () => undefined,
type: 'number',
width: columnWidths.duration ?? defaultColumnWidths.duration ?? MIN_COLUMN_WIDTH,
},
externalExperimentId: {
Expand Down Expand Up @@ -305,7 +305,6 @@ export const getColumnDefs = ({
},
numTrials: {
id: 'numTrials',
isNumerical: true,
renderer: (record: ExperimentWithTrial) => ({
allowOverlay: false,
data: record.experiment.numTrials,
Expand All @@ -314,6 +313,7 @@ export const getColumnDefs = ({
}),
title: 'Trials',
tooltip: () => undefined,
type: 'number',
width: columnWidths.numTrials ?? defaultColumnWidths.numTrials ?? MIN_COLUMN_WIDTH,
},
progress: {
Expand Down Expand Up @@ -346,7 +346,6 @@ export const getColumnDefs = ({
},
searcherMetric: {
id: 'searcherMetric',
isNumerical: false,
renderer: (record: ExperimentWithTrial) => {
const sMetric = record.experiment.searcherMetric ?? '';
return {
Expand Down Expand Up @@ -374,7 +373,6 @@ export const getColumnDefs = ({
},
startTime: {
id: 'startTime',
isNumerical: true,
renderer: (record: ExperimentWithTrial) => ({
allowOverlay: false,
copyData: getTimeInEnglish(new Date(record.experiment.startTime)),
Expand All @@ -383,6 +381,7 @@ export const getColumnDefs = ({
}),
title: 'Start Time',
tooltip: () => undefined,
type: 'number',
width: columnWidths.startTime ?? defaultColumnWidths.startTime ?? MIN_COLUMN_WIDTH,
},
state: {
Expand Down Expand Up @@ -456,7 +455,6 @@ export const searcherMetricsValColumn = (
): ColumnDef<ExperimentWithTrial> => {
return {
id: 'searcherMetricsVal',
isNumerical: true,
renderer: (record: ExperimentWithTrial) => {
const sMetricValue = record.bestTrial?.searcherMetricsVal;

Expand All @@ -483,6 +481,7 @@ export const searcherMetricsValColumn = (
},
title: 'Searcher Metric Value',
tooltip: () => undefined,
type: 'number',
width: columnWidth ?? DEFAULT_COLUMN_WIDTH,
};
};
Expand Down
18 changes: 12 additions & 6 deletions webui/react/src/pages/FlatRuns/columns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ export const getColumnDefs = ({
},
checkpointCount: {
id: 'checkpointCount',
isNumerical: true,
renderer: (record: FlatRun) => ({
allowOverlay: false,
data: Number(record.checkpointCount),
Expand All @@ -136,11 +135,11 @@ export const getColumnDefs = ({
}),
title: 'Checkpoints',
tooltip: () => undefined,
type: 'number',
width: columnWidths.checkpointCount ?? defaultColumnWidths.checkpointCount ?? MIN_COLUMN_WIDTH,
},
checkpointSize: {
id: 'checkpointSize',
isNumerical: true,
renderer: (record: FlatRun) => ({
allowOverlay: false,
copyData: humanReadableBytes(record.checkpointSize),
Expand All @@ -149,11 +148,11 @@ export const getColumnDefs = ({
}),
title: 'Checkpoint Size',
tooltip: () => undefined,
type: 'number',
width: columnWidths.checkpointSize ?? defaultColumnWidths.checkpointSize ?? MIN_COLUMN_WIDTH,
},
duration: {
id: 'duration',
isNumerical: true,
renderer: (record: FlatRun) =>
handleEmptyCell(record.duration, (data) => ({
allowOverlay: false,
Expand All @@ -169,6 +168,7 @@ export const getColumnDefs = ({
})),
title: 'Duration',
tooltip: () => undefined,
type: 'number',
width: columnWidths.duration ?? defaultColumnWidths.duration ?? MIN_COLUMN_WIDTH,
},
experimentDescription: {
Expand All @@ -186,6 +186,7 @@ export const getColumnDefs = ({
),
title: 'Search Description',
tooltip: () => undefined,
type: 'text',
width:
columnWidths.experimentDescription ??
defaultColumnWidths.experimentDescription ??
Expand Down Expand Up @@ -249,6 +250,7 @@ export const getColumnDefs = ({
})),
title: 'Search Name',
tooltip: () => undefined,
type: 'text',
width: columnWidths.experimentName ?? defaultColumnWidths.experimentName ?? MIN_COLUMN_WIDTH,
},

Expand All @@ -263,6 +265,7 @@ export const getColumnDefs = ({
})),
title: 'Search Progress',
tooltip: () => undefined,
type: 'number',
width:
columnWidths.experimentProgress ?? defaultColumnWidths.experimentProgress ?? MIN_COLUMN_WIDTH,
},
Expand All @@ -278,6 +281,7 @@ export const getColumnDefs = ({
})),
title: 'External Experiment ID',
tooltip: () => undefined,
type: 'text',
width:
columnWidths.externalExperimentId ??
defaultColumnWidths.externalExperimentId ??
Expand All @@ -294,6 +298,7 @@ export const getColumnDefs = ({
})),
title: 'External Run ID',
tooltip: () => undefined,
type: 'text',
width: columnWidths.externalRunId ?? defaultColumnWidths.externalRunId ?? MIN_COLUMN_WIDTH,
},
forkedFrom: {
Expand Down Expand Up @@ -321,6 +326,7 @@ export const getColumnDefs = ({
})),
title: 'Forked From',
tooltip: () => undefined,
type: 'number',
width: columnWidths.forkedFrom ?? defaultColumnWidths.forkedFrom ?? MIN_COLUMN_WIDTH,
},
id: {
Expand Down Expand Up @@ -353,6 +359,7 @@ export const getColumnDefs = ({
}),
title: 'ID',
tooltip: () => undefined,
type: 'number',
width: columnWidths.id ?? defaultColumnWidths.id ?? MIN_COLUMN_WIDTH,
},
isExpMultitrial: {
Expand Down Expand Up @@ -394,7 +401,6 @@ export const getColumnDefs = ({
},
searcherMetric: {
id: 'searcherMetric',
isNumerical: false,
renderer: (record: FlatRun) =>
handleEmptyCell(record.experiment?.searcherMetric, (data) => ({
allowOverlay: false,
Expand All @@ -421,7 +427,6 @@ export const getColumnDefs = ({
},
startTime: {
id: 'startTime',
isNumerical: true,
renderer: (record: FlatRun) => ({
allowOverlay: false,
copyData: getTimeInEnglish(new Date(record.startTime)),
Expand All @@ -430,6 +435,7 @@ export const getColumnDefs = ({
}),
title: 'Start Time',
tooltip: () => undefined,
type: 'number',
width: columnWidths.startTime ?? defaultColumnWidths.startTime ?? MIN_COLUMN_WIDTH,
},
state: {
Expand Down Expand Up @@ -505,7 +511,6 @@ export const searcherMetricsValColumn = (
): ColumnDef<FlatRun> => {
return {
id: 'searcherMetricsVal',
isNumerical: true,
renderer: (record: FlatRun) => {
const sMetricValue = record.searcherMetricValue;

Expand All @@ -528,6 +533,7 @@ export const searcherMetricsValColumn = (
},
title: 'Searcher Metric Value',
tooltip: () => undefined,
type: 'number',
width: columnWidth ?? defaultColumnWidths.searcherMetricsVal ?? MIN_COLUMN_WIDTH,
};
};
Expand Down

0 comments on commit 4e3c1c6

Please sign in to comment.