def test_experiment_worker_as_parameter(self): """Tests that ``Experiment`` is a valid parameter""" with create_experiment(config, trial_config, ["completed"]) as ( _, experiment, _, ): plot = regret(experiment) assert_regret_plot(plot)
def test_graph_layout(self): """Tests the layout of the plot""" with create_experiment(config, trial_config, ["completed"]) as ( _, _, experiment, ): plot = regret(experiment) assert_regret_plot(plot)
def test_returns_plotly_object(self): """Tests that the plotly backend returns a plotly object""" with create_experiment(config, trial_config, ["completed"]) as ( _, _, experiment, ): plot = regret(experiment) assert type(plot) is plotly.graph_objects.Figure
def test_unsupported_order_key(self): """Tests that unsupported order keys are rejected""" with create_experiment(config, trial_config) as (_, _, experiment): with pytest.raises(ValueError): regret(experiment, order_by="unsupported")
def test_ignore_uncompleted_statuses(self): """Tests that uncompleted statuses are ignored""" with create_experiment(config, trial_config) as (_, _, experiment): plot = regret(experiment) assert_regret_plot(plot)
def test_requires_argument(self): """Tests that the experiment data are required.""" with pytest.raises(ValueError): regret(None)
database=dict(type="pickleddb", host="../../db.pkl")) # Load the data for the specified experiment experiment = get_experiment("2-dim-exp", storage=storage) fig = experiment.plot.regret() fig.show() #%% # Module ``plotting`` # ------------------- # # The plotting module can used as well to plot experiments. import orion.plotting.base as plot fig = plot.regret(experiment) fig.show() #%% # The advantage of the plotting module is that it can render plots using # multiple examples as shown in the example below. # fig = plot.regret(experiment) fig.show() # sphinx_gallery_thumbnail_path = '_static/paint.png' #%% # Command ``orion plot`` # ----------------------