docstr: This test ensures that the default completion criterion for GenerationSteps
  is set as expected.
  
  The default completion criterion is to create two TransitionCriterion, one
  of type `MaximumTrialsInStatus` and one of type `MinTrials`.
  These are constructed via the inputs of `num_trials`, `enforce_num_trials`,
  and `minimum_trials_observed` on the GenerationStep.
docstr_tok: ["This","test","ensures","that","the","default","completion","criterion","for","GenerationSteps","is","set","as","expected",".","The","default","completion","criterion","is","to","create","two","TransitionCriterion",",","one","of","type","`","MaximumTrialsInStatus","`","and","one","of","type","`","MinTrials","`",".","These","are","constructed","via","the","inputs","of","`","num_trials","`",",","`","enforce_num_trials","`",",","and","`","minimum_trials_observed","`","on","the","GenerationStep","."]
code: def test_default_step_criterion_setup(self) -> None:
      """This test ensures that the default completion criterion for GenerationSteps
      is set as expected.
  
      The default completion criterion is to create two TransitionCriterion, one
      of type `MaximumTrialsInStatus` and one of type `MinTrials`.
      These are constructed via the inputs of `num_trials`, `enforce_num_trials`,
      and `minimum_trials_observed` on the GenerationStep.
      """
      experiment = get_experiment()
      gs = GenerationStrategy(
          name="SOBOL+GPEI::default",
          steps=[
              GenerationStep(
                  model=Models.SOBOL,
                  num_trials=3,
              ),
              GenerationStep(
                  model=Models.GPEI,
                  num_trials=4,
                  max_parallelism=1,
                  min_trials_observed=2,
                  enforce_num_trials=False,
              ),
              GenerationStep(
                  model=Models.GPEI,
                  num_trials=-1,
              ),
          ],
      )
      gs.experiment = experiment
  
      step_0_expected_transition_criteria = [
          MaxTrials(
              threshold=3,
              block_gen_if_met=True,
              transition_to="GenerationStep_1",
              only_in_statuses=None,
              not_in_statuses=[
                  TrialStatus.FAILED,
                  TrialStatus.ABANDONED,
              ],
          ),
      ]
      step_1_expected_transition_criteria = [
          MaxTrials(
              threshold=4,
              block_gen_if_met=False,
              transition_to="GenerationStep_2",
              only_in_statuses=None,
              not_in_statuses=[
                  TrialStatus.FAILED,
                  TrialStatus.ABANDONED,
              ],
          ),
          MinTrials(
              only_in_statuses=[
                  TrialStatus.COMPLETED,
                  TrialStatus.EARLY_STOPPED,
              ],
              threshold=2,
              transition_to="GenerationStep_2",
          ),
          MaxGenerationParallelism(
              threshold=1,
              only_in_statuses=[TrialStatus.RUNNING],
              block_gen_if_met=True,
              block_transition_if_unmet=False,
          ),
      ]
      step_2_expected_transition_criteria = []
      self.assertEqual(
          gs._steps[0].transition_criteria,
          step_0_expected_transition_criteria,
      )
      self.assertEqual(
          gs._steps[1].transition_criteria,
          step_1_expected_transition_criteria,
      )
      self.assertEqual(
          gs._steps[2].transition_criteria,
          step_2_expected_transition_criteria,
      )
  
file_path: Ax/ax/modelbridge/tests/test_transition_criterion.py
imports: import logging
  from logging import Logger
  from unittest.mock import patch
  import pandas
  from ax.core.base_trial import TrialStatus
  from ax.core.data import Data
  from ax.modelbridge.generation_strategy import GenerationStep, GenerationStrategy
  from ax.modelbridge.registry import Models
  from ax.modelbridge.transition_criterion import MaxGenerationParallelism, MaxTrials, MinimumPreferenceOccurances, MinimumTrialsInStatus, MinTrials, TransitionCriterion
  from ax.utils.common.logger import get_logger
  from ax.utils.common.testutils import TestCase
  from ax.utils.testing.core_stubs import get_branin_experiment, get_experiment
label_desc: Use image node_id 2 for calling the TestTransitionCriterion obj's underlying member method code with example usage: obj.test_default_step_criterion_setup() without return types