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