示例#1
0
def test_generate_contour_plot_for_few_observations() -> None:

    study = prepare_study_with_trials(less_than_two=True)
    trials = study.trials

    # `x_axis` has one observation.
    params = ["param_a", "param_b"]
    contour, scatter = _generate_contour_subplot(trials, params[0], params[1],
                                                 StudyDirection.MINIMIZE)
    assert contour.x is None and contour.y is None and scatter.x is None and scatter.y is None

    # `y_axis` has one observation.
    params = ["param_b", "param_a"]
    contour, scatter = _generate_contour_subplot(trials, params[0], params[1],
                                                 StudyDirection.MINIMIZE)
    assert contour.x is None and contour.y is None and scatter.x is None and scatter.y is None
示例#2
0
def test_generate_contour_plot_for_few_observations() -> None:

    study = prepare_study_with_trials(less_than_two=True)
    trials = study.trials
    reverse_scale = _is_reverse_scale(study, target=None)

    # `x_axis` has one observation.
    params = ["param_a", "param_b"]
    contour, scatter = _generate_contour_subplot(trials, params[0], params[1],
                                                 reverse_scale)
    assert contour.x is None and contour.y is None and scatter.x is None and scatter.y is None

    # `y_axis` has one observation.
    params = ["param_b", "param_a"]
    contour, scatter = _generate_contour_subplot(trials, params[0], params[1],
                                                 reverse_scale)
    assert contour.x is None and contour.y is None and scatter.x is None and scatter.y is None