docstr: Test that the is_met method in  MinTrials works
docstr_tok: ["Test","that","the","is_met","method","in","MinTrials","works"]
code: def test_min_trials_is_met(self) -> None:
      """Test that the is_met method in  MinTrials works"""
      experiment = get_branin_experiment()
      gs = GenerationStrategy(
          name="SOBOL::default",
          steps=[
              GenerationStep(
                  model=Models.SOBOL,
                  num_trials=4,
                  min_trials_observed=2,
                  enforce_num_trials=True,
              ),
              GenerationStep(
                  Models.SOBOL,
                  num_trials=-1,
                  max_parallelism=1,
              ),
          ],
      )
      gs.experiment = experiment
  
      # Need to add trials to test the transition criteria `is_met` method
      for _i in range(4):
          experiment.new_trial(gs.gen(experiment=experiment))
  
      # TODO: @mgarrard More comphrensive test of trials_from_node
      node_0_trials = gs._steps[0].trials_from_node
      node_1_trials = gs._steps[1].trials_from_node
  
      self.assertEqual(len(node_0_trials), 4)
      self.assertEqual(len(node_1_trials), 0)
  
      # MinTrials is met should not pass yet, becasue no trials
      # are marked completed
      self.assertFalse(
          gs._steps[0]
          .transition_criteria[1]
          .is_met(experiment, gs._steps[0].trials_from_node)
      )
  
      # Should pass after two trials are marked completed
      for idx, trial in experiment.trials.items():
          trial.mark_running(no_runner_required=True).mark_completed()
          if idx == 1:
              break
      self.assertTrue(
          gs._steps[0]
          .transition_criteria[1]
          .is_met(experiment, gs._steps[0].trials_from_node)
      )
  
      # Check mixed status MinTrials
      min_criterion = MinTrials(
          threshold=3,
          only_in_statuses=[
              TrialStatus.COMPLETED,
              TrialStatus.EARLY_STOPPED,
          ],
      )
      self.assertFalse(
          min_criterion.is_met(
              experiment, gs._steps[0].trials_from_node
          )
      )
      for idx, trial in experiment.trials.items():
          if idx == 2:
              trial._status = TrialStatus.EARLY_STOPPED
      self.assertTrue(
          min_criterion.is_met(
              experiment, gs._steps[0].trials_from_node
          )
      )
  
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 3 for calling the TestTransitionCriterion obj's underlying member method code with example usage: obj.test_min_trials_is_met() without return types