diff --git a/ax/modelbridge/completion_criterion.py b/ax/modelbridge/completion_criterion.py index 902b4cbbcec..8e2dee001b2 100644 --- a/ax/modelbridge/completion_criterion.py +++ b/ax/modelbridge/completion_criterion.py @@ -5,10 +5,7 @@ from logging import Logger -from ax.modelbridge.transition_criterion import ( - MinimumPreferenceOccurances, - TransitionCriterion, -) +from ax.modelbridge.transition_criterion import TransitionCriterion from ax.utils.common.logger import get_logger logger: Logger = get_logger(__name__) @@ -24,16 +21,3 @@ class CompletionCriterion(TransitionCriterion): "CompletionCriterion is deprecated, please use TransitionCriterion instead." ) pass - - -class MinimumPreferenceOccurances(MinimumPreferenceOccurances): - """ - Deprecated child class that has been replaced by `MinimumPreferenceOccurances` - in `TransitionCriterion`, and will be fully reaped in a future release. - """ - - logger.warning( - "CompletionCriterion, which MinimumPreferenceOccurance inherits from, is" - " deprecated. Please use TransitionCriterion instead." - ) - pass diff --git a/ax/modelbridge/tests/test_completion_criterion.py b/ax/modelbridge/tests/test_completion_criterion.py index cf3ca2d78d3..e0d60b80f89 100644 --- a/ax/modelbridge/tests/test_completion_criterion.py +++ b/ax/modelbridge/tests/test_completion_criterion.py @@ -8,10 +8,9 @@ import pandas as pd from ax.core.base_trial import TrialStatus from ax.core.data import Data -from ax.modelbridge.completion_criterion import MinimumPreferenceOccurances from ax.modelbridge.generation_strategy import GenerationStep, GenerationStrategy from ax.modelbridge.registry import Models -from ax.modelbridge.transition_criterion import MinTrials +from ax.modelbridge.transition_criterion import MinimumPreferenceOccurances, MinTrials from ax.utils.common.testutils import TestCase from ax.utils.testing.core_stubs import get_experiment diff --git a/ax/modelbridge/tests/test_transition_criterion.py b/ax/modelbridge/tests/test_transition_criterion.py index 9fbde23aeca..d9f0faad62e 100644 --- a/ax/modelbridge/tests/test_transition_criterion.py +++ b/ax/modelbridge/tests/test_transition_criterion.py @@ -409,7 +409,8 @@ def test_repr(self) -> None: self.assertEqual( str(minimum_preference_occurances_criterion), "MinimumPreferenceOccurances({'metric_name': 'm1', 'threshold': 3, " - + "'transition_to': None, 'block_gen_if_met': False})", + + "'transition_to': None, 'block_gen_if_met': False, " + "'block_transition_if_unmet': True})", ) deprecated_min_trials_criterion = MinimumTrialsInStatus( status=TrialStatus.COMPLETED, threshold=3 diff --git a/ax/modelbridge/transition_criterion.py b/ax/modelbridge/transition_criterion.py index 022ca6c3406..f964a3cbcd3 100644 --- a/ax/modelbridge/transition_criterion.py +++ b/ax/modelbridge/transition_criterion.py @@ -340,12 +340,14 @@ def __init__( threshold: int, transition_to: Optional[str] = None, block_gen_if_met: Optional[bool] = False, + block_transition_if_unmet: Optional[bool] = True, ) -> None: self.metric_name = metric_name self.threshold = threshold super().__init__( transition_to=transition_to, block_gen_if_met=block_gen_if_met, + block_transition_if_unmet=block_transition_if_unmet, ) def is_met(