test: add test for paramType property
This commit is contained in:
@@ -43,6 +43,7 @@ def test_hyperopt_int_parameter():
|
|||||||
|
|
||||||
HyperoptStateContainer.set_state(HyperoptState.OPTIMIZE)
|
HyperoptStateContainer.set_state(HyperoptState.OPTIMIZE)
|
||||||
assert len(list(intpar.range)) == 1
|
assert len(list(intpar.range)) == 1
|
||||||
|
assert intpar.param_type == "IntParameter"
|
||||||
|
|
||||||
|
|
||||||
def test_hyperopt_real_parameter():
|
def test_hyperopt_real_parameter():
|
||||||
@@ -60,6 +61,7 @@ def test_hyperopt_real_parameter():
|
|||||||
assert isinstance(fltpar.get_space(""), FloatDistribution)
|
assert isinstance(fltpar.get_space(""), FloatDistribution)
|
||||||
|
|
||||||
assert not hasattr(fltpar, "range")
|
assert not hasattr(fltpar, "range")
|
||||||
|
assert fltpar.param_type == "RealParameter"
|
||||||
|
|
||||||
|
|
||||||
def test_hyperopt_decimal_parameter():
|
def test_hyperopt_decimal_parameter():
|
||||||
@@ -94,6 +96,7 @@ def test_hyperopt_decimal_parameter():
|
|||||||
|
|
||||||
HyperoptStateContainer.set_state(HyperoptState.OPTIMIZE)
|
HyperoptStateContainer.set_state(HyperoptState.OPTIMIZE)
|
||||||
assert len(list(decimalpar.range)) == 1
|
assert len(list(decimalpar.range)) == 1
|
||||||
|
assert decimalpar.param_type == "DecimalParameter"
|
||||||
|
|
||||||
|
|
||||||
def test_hyperopt_categorical_parameter():
|
def test_hyperopt_categorical_parameter():
|
||||||
@@ -133,3 +136,5 @@ def test_hyperopt_categorical_parameter():
|
|||||||
HyperoptStateContainer.set_state(HyperoptState.OPTIMIZE)
|
HyperoptStateContainer.set_state(HyperoptState.OPTIMIZE)
|
||||||
assert len(list(catpar.range)) == 1
|
assert len(list(catpar.range)) == 1
|
||||||
assert len(list(boolpar.range)) == 1
|
assert len(list(boolpar.range)) == 1
|
||||||
|
assert boolpar.param_type == "BooleanParameter"
|
||||||
|
assert catpar.param_type == "CategoricalParameter"
|
||||||
|
|||||||
Reference in New Issue
Block a user