Esempio n. 1
0
def test_paramset_unconstrained():
    pset = paramsets.unconstrained(
        n_parameters=5,
        inits=[0, 1, 2, 3, 4],
        bounds=[(-1, 1), (-2, 2), (-3, 3), (-4, 4)],
    )
    assert pset.suggested_init == [0, 1, 2, 3, 4]
    assert pset.suggested_bounds == [(-1, 1), (-2, 2), (-3, 3), (-4, 4)]
    assert not pset.constrained
Esempio n. 2
0
def test_paramset_unconstrained():
    pset = paramsets.unconstrained(
        name='foo',
        is_scalar=False,
        n_parameters=5,
        inits=[0, 1, 2, 3, 4],
        bounds=[(-1, 1), (-2, 2), (-3, 3), (-4, 4)],
        fixed=False,
    )
    assert pset.suggested_init == [0, 1, 2, 3, 4]
    assert pset.suggested_bounds == [(-1, 1), (-2, 2), (-3, 3), (-4, 4)]
    assert not pset.suggested_fixed
    assert not pset.constrained