class_docstr: Tests for the algo ASHA.
class_docstr_tok: ["Tests","for","the","algo","ASHA","."]
docstr: Check that a point is registered inside the good bracket when higher fidelity.
code: def test_register_next_bracket(self, space: Space, b_config: dict):
      """Check that a point is registered inside the good bracket when higher fidelity."""
      asha = ASHA(space, num_brackets=3)
  
      value = 50
      fidelity = 3
      trial = create_trial_for_hb((fidelity, value), 0.0)
      trial_id = asha.get_id(trial, ignore_fidelity=True)
  
      force_observe(asha, trial)
  
      assert (
          sum(len(rung["results"]) for rung in asha.brackets[0].rungs)
          == 0
      )
      assert (
          sum(len(rung["results"]) for rung in asha.brackets[1].rungs)
          == 1
      )
      assert (
          sum(len(rung["results"]) for rung in asha.brackets[2].rungs)
          == 0
      )
      assert trial_id in asha.brackets[1].rungs[0]["results"]
      compare_registered_trial(
          asha.brackets[1].rungs[0]["results"][trial_id], trial
      )
  
      value = 51
      fidelity = 9
      trial = create_trial_for_hb((fidelity, value), 0.0)
      trial_id = asha.get_id(trial, ignore_fidelity=True)
  
      force_observe(asha, trial)
  
      assert (
          sum(len(rung["results"]) for rung in asha.brackets[0].rungs)
          == 0
      )
      assert (
          sum(len(rung["results"]) for rung in asha.brackets[1].rungs)
          == 1
      )
      assert (
          sum(len(rung["results"]) for rung in asha.brackets[2].rungs)
          == 1
      )
      assert trial_id in asha.brackets[2].rungs[0]["results"]
      compare_registered_trial(
          asha.brackets[2].rungs[0]["results"][trial_id], trial
      )
  
imports: from __future__ import annotations
  import hashlib
  import logging
  from typing import ClassVar
  import numpy
  import pytest
  from test_hyperband import compare_registered_trial, create_rung_from_points, create_trial_for_hb, force_observe
  from orion.algo.asha import ASHA, ASHABracket, compute_budgets
  from orion.algo.hyperband import RungDict
  from orion.algo.space import Fidelity, Integer, Real, Space
  from orion.core.worker.primary_algo import SpaceTransform
  from orion.testing.algo import BaseAlgoTests, TestPhase
  from orion.testing.trial import create_trial
label_desc: Use image node_id 3 for calling the TestASHA obj's underlying member method code with example usage: obj.test_register_next_bracket(space, b_config) without return types