From ac8f33a6312091fcbf4c4e6e54a042d09fd8ba70 Mon Sep 17 00:00:00 2001 From: Vincent Michalski Date: Sun, 1 May 2022 21:14:59 -0400 Subject: [PATCH 1/2] Fix IndexError for freshly branched exp Plotting backend functions require a trial to read the objective of the experiment. A freshly branched experiment has no own trials, so we fetch those from the evc tree instead. --- src/orion/plotting/backend_plotly.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/orion/plotting/backend_plotly.py b/src/orion/plotting/backend_plotly.py index 0da3ad166..3c293aa9c 100644 --- a/src/orion/plotting/backend_plotly.py +++ b/src/orion/plotting/backend_plotly.py @@ -124,7 +124,8 @@ def get_dimension(data, name, dim): if df.empty: return go.Figure() - trial = experiment.fetch_trials_by_status("completed")[0] + trial = experiment.fetch_trials_by_status( + "completed", with_evc_tree=with_evc_tree)[0] flattened_space = build_required_space( experiment.space, shape_requirement="flattened" @@ -518,7 +519,8 @@ def build_frame(): if df.empty: return fig - trial = experiment.fetch_trials_by_status("completed")[0] + trial = experiment.fetch_trials_by_status( + "completed", with_evc_tree=with_evc_tree)[0] fig.add_scatter( y=df["objective"], From bdecea8f1dbb01cc273b9eee27b6fd88226e724d Mon Sep 17 00:00:00 2001 From: Vincent Michalski Date: Mon, 2 May 2022 10:32:45 -0400 Subject: [PATCH 2/2] ran black to fix formatting --- src/orion/plotting/backend_plotly.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/orion/plotting/backend_plotly.py b/src/orion/plotting/backend_plotly.py index 3c293aa9c..3f03994bf 100644 --- a/src/orion/plotting/backend_plotly.py +++ b/src/orion/plotting/backend_plotly.py @@ -124,8 +124,9 @@ def get_dimension(data, name, dim): if df.empty: return go.Figure() - trial = experiment.fetch_trials_by_status( - "completed", with_evc_tree=with_evc_tree)[0] + trial = experiment.fetch_trials_by_status("completed", with_evc_tree=with_evc_tree)[ + 0 + ] flattened_space = build_required_space( experiment.space, shape_requirement="flattened" @@ -519,8 +520,9 @@ def build_frame(): if df.empty: return fig - trial = experiment.fetch_trials_by_status( - "completed", with_evc_tree=with_evc_tree)[0] + trial = experiment.fetch_trials_by_status("completed", with_evc_tree=with_evc_tree)[ + 0 + ] fig.add_scatter( y=df["objective"],