diff --git a/ax/core/parameter.py b/ax/core/parameter.py index 1e73f1720f0..fa4dc2a0e33 100644 --- a/ax/core/parameter.py +++ b/ax/core/parameter.py @@ -40,7 +40,7 @@ # TODO: Do a more comprehensive audit of how floating point precision issues # may creep up and implement a more principled fix EPS = 1.5e-7 -MAX_VALUES_CHOICE_PARAM = 1000 +MAX_VALUES_CHOICE_PARAM = 1001 FIXED_CHOICE_PARAM_ERROR = ( "ChoiceParameters require multiple feasible values. " "Please use FixedParameter instead when setting a single possible value." diff --git a/ax/core/tests/test_parameter.py b/ax/core/tests/test_parameter.py index dc40742aa8f..a86ab05a7aa 100644 --- a/ax/core/tests/test_parameter.py +++ b/ax/core/tests/test_parameter.py @@ -490,17 +490,17 @@ def test_MaxValuesValidation(self) -> None: ChoiceParameter( name="x", parameter_type=ParameterType.INT, - values=list(range(999)), + values=list(range(1000)), ) with self.assertRaisesRegex( UserInputError, - "`ChoiceParameter` with more than 1000 values is not supported! Use a " + "`ChoiceParameter` with more than 1001 values is not supported! Use a " "`RangeParameter` instead.", ): ChoiceParameter( name="x", parameter_type=ParameterType.INT, - values=list(range(1001)), + values=list(range(1002)), ) # With bypass_cardinality_check=True, this should not raise an error. p = ChoiceParameter(