Skip to content

Commit c618f26

Browse files
Racer Engineerfacebook-github-bot
authored andcommitted
Bump MAX_VALUES_CHOICE_PARAM from 1000 to 1001 (#5116)
Summary: ## Summary: Bump `MAX_VALUES_CHOICE_PARAM` from 1000 to 1001 in Ax `ChoiceParameter` to fix GitHub issue facebook/Ax #5108. Users commonly want to split [0, 1] in 0.001 steps, yielding 1001 elements. The previous limit of 1000 blocked this natural use case. Updated the constant in `parameter.py` and adjusted 3 test values in `test_parameter.py` to match the new limit. Internal --- ## Instructions about RACER Diffs: **Commandeer this diff (recommended) or land with accept2ship tag.** **This diff was generated by Racer AI agent on behalf of [Cesar Cardoso](https://www.internalfb.com/profile/view/100028184453680) for T262124460. If the diff quality is poor, consider contacting the user to provide clearer instructions on the task.** - If you are happy with the changes, commandeer it if minor edits are needed. (**we encourage commandeer to get the diff credit**) - If you are not happy with the changes, please comment on the diff with clear actions and send it back to the author. Racer will pick it up and re-generate. - If you really feel the Racer is not helping with this change (alas, some complex changes are hard for AI) feel free to abandon this diff. - **For M10N reviewers:** as you review AI-generated diffs, we ask you to give them the same priority as human-generated diffs, and take action in a timely manner by either accepting, rejecting, or resigning as a reviewer. For diffs that don't meet the quality bar (e.g. code doesn't compile, not readable or introduces functionality regressions), we ask that you use the following hashtags to provide clear signals to improve our tools - `#monlowqualitydiff` `#monwrongreviewerdiff` --- > Generated by [RACER](https://www.internalfb.com/wiki/RACER_(Risk-Aware_Code_Editing_and_Refactoring)/), powered by [Confucius](https://www.internalfb.com/wiki/Confucius/Analect/Shared_Analects/Confucius_Code_Assist_(CCA)/) [Session](https://www.internalfb.com/confucius?session_id=f5214618-2c52-11f1-b857-dd63b4a9f85c&tab=Chat), [Trace](https://www.internalfb.com/confucius?session_id=f5214618-2c52-11f1-b857-dd63b4a9f85c&tab=Trace) Reviewed By: Cesar-Cardoso Differential Revision: D98747907
1 parent 6cebd1c commit c618f26

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

ax/core/parameter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
# TODO: Do a more comprehensive audit of how floating point precision issues
4141
# may creep up and implement a more principled fix
4242
EPS = 1.5e-7
43-
MAX_VALUES_CHOICE_PARAM = 1000
43+
MAX_VALUES_CHOICE_PARAM = 1001
4444
FIXED_CHOICE_PARAM_ERROR = (
4545
"ChoiceParameters require multiple feasible values. "
4646
"Please use FixedParameter instead when setting a single possible value."

ax/core/tests/test_parameter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -490,17 +490,17 @@ def test_MaxValuesValidation(self) -> None:
490490
ChoiceParameter(
491491
name="x",
492492
parameter_type=ParameterType.INT,
493-
values=list(range(999)),
493+
values=list(range(1000)),
494494
)
495495
with self.assertRaisesRegex(
496496
UserInputError,
497-
"`ChoiceParameter` with more than 1000 values is not supported! Use a "
497+
"`ChoiceParameter` with more than 1001 values is not supported! Use a "
498498
"`RangeParameter` instead.",
499499
):
500500
ChoiceParameter(
501501
name="x",
502502
parameter_type=ParameterType.INT,
503-
values=list(range(1001)),
503+
values=list(range(1002)),
504504
)
505505
# With bypass_cardinality_check=True, this should not raise an error.
506506
p = ChoiceParameter(

0 commit comments

Comments
 (0)