def test_bayesian_dynamic_space(tmp_dir):
    hps = hp_module.HyperParameters()
    hps.Choice('a', [1, 2], default=1)
    oracle = bo_module.BayesianOptimizationOracle(objective='val_acc', max_trials=20, num_initial_points=10)
    oracle._set_project_dir(tmp_dir, 'untitled')
    oracle.hyperparameters = hps
    for i in range(10):
        oracle._populate_space(str(i))
    hps.Int('b', 3, 10, default=3)
    assert ('b' in oracle._populate_space('1_0')['values'])
    hps.Float('c', 0, 1, 0.1, default=0)
    assert ('c' in oracle._populate_space('1_1')['values'])
    hps.Fixed('d', 7)
    assert ('d' in oracle._populate_space('1_2')['values'])
    hps.Choice('e', [9, 0], default=9)
    assert ('e' in oracle._populate_space('1_3')['values'])
def test_bayesian_dynamic_space(tmp_dir):
    hps = hp_module.HyperParameters()
    hps.Choice('a', [1, 2], default=1)
    oracle = bo_module.BayesianOptimizationOracle(objective='val_acc', max_trials=20, num_initial_points=10)
    oracle._set_project_dir(tmp_dir, 'untitled')
    oracle.hyperparameters = hps
    for i in range(10):
        oracle._populate_space(str(i))
    hps.Int('b', 3, 10, default=3)
    assert ('b' in oracle._populate_space('1_0')['values'])
    hps.Float('c', 0, 1, 0.1, default=0)
    assert ('c' in oracle._populate_space('1_1')['values'])
    hps.Fixed('d', 7)
    assert ('d' in oracle._populate_space('1_2')['values'])
    hps.Choice('e', [9, 0], default=9)
    assert ('e' in oracle._populate_space('1_3')['values'])