Skip to content
Closed
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
5 changes: 4 additions & 1 deletion optuna_dashboard/ts/components/GraphContour.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,10 @@ const plotContour = (

filteredTrials.forEach((trial, i) => {
if (xAxis.values[i] && yAxis.values[i] && trial.values) {
if (trial.constraints.every((c) => c <= 0)) {
if (
trial.constraints === null ||
trial.constraints.every((c) => c <= 0)
) {
feasibleXY.add(xValues.length)
}
const xValue = xAxis.values[i] as string | number
Expand Down
2 changes: 1 addition & 1 deletion optuna_dashboard/ts/components/GraphParetoFront.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ const plotParetoFront = (
const feasibleTrials: Trial[] = []
const infeasibleTrials: Trial[] = []
filteredTrials.forEach((t) => {
if (t.constraints.every((c) => c <= 0)) {
if (t.constraints === null || t.constraints.every((c) => c <= 0)) {
feasibleTrials.push(t)
} else {
infeasibleTrials.push(t)
Expand Down
3 changes: 2 additions & 1 deletion optuna_dashboard/ts/components/GraphRank.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ const getRankPlotInfo = (
yValues.push(yValue)
const zValue = trial.values[objectiveId]
zValues.push(zValue)
const feasibility = trial.constraints.every((c) => c <= 0)
const feasibility =
trial.constraints === null || trial.constraints.every((c) => c <= 0)
isFeasible.push(feasibility)
hovertext.push(makeHovertext(trial))
}
Expand Down
8 changes: 4 additions & 4 deletions optuna_dashboard/ts/components/GraphTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,11 @@ const plotTimeline = (
continue
}
if (state === "Complete") {
const feasibleTrials = bars.filter((t) =>
t.constraints.every((c) => c <= 0)
const feasibleTrials = bars.filter(
(t) => t.constraints === null || t.constraints.every((c) => c <= 0)
)
const infeasibleTrials = bars.filter((t) =>
t.constraints.some((c) => c > 0)
const infeasibleTrials = bars.filter(
(t) => t.constraints !== null && t.constraints.some((c) => c > 0)
)
if (feasibleTrials.length > 0) {
traces.push(makeTrace(feasibleTrials, "Complete", color))
Expand Down
2 changes: 1 addition & 1 deletion tslib/react/src/components/PlotHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ const plotHistory = (
const feasibleTrials: Optuna.Trial[] = []
const infeasibleTrials: Optuna.Trial[] = []
for (const t of h.trials) {
if (t.constraints.every((c) => c <= 0)) {
if (t.constraints === null || t.constraints.every((c) => c <= 0)) {
feasibleTrials.push(t)
} else {
infeasibleTrials.push(t)
Expand Down
2 changes: 1 addition & 1 deletion tslib/react/src/components/PlotSlice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ const plotSlice = (
const infeasibleTrials: Optuna.Trial[] = []
// biome-ignore lint/complexity/noForEach: <explanation>
trials.forEach((t) => {
if (t.constraints.every((c) => c <= 0)) {
if (t.constraints === null || t.constraints.every((c) => c <= 0)) {
feasibleTrials.push(t)
} else {
infeasibleTrials.push(t)
Expand Down