class_docstr: Tests for the algo Hyperband.
class_docstr_tok: ["Tests","for","the","algo","Hyperband","."]
docstr: Test that Hyperband bracket detects when rung is filled.
docstr_tok: ["Test","that","Hyperband","bracket","detects","when","rung","is","filled","."]
code: def test_is_filled(
      self,
      hyperband: Hyperband,
      bracket: HyperbandBracket,
      rung_0: RungDict,
      rung_1: RungDict,
      rung_2: RungDict,
  ):
      """Test that Hyperband bracket detects when rung is filled."""
      hyperband.brackets = [bracket]
      assert bracket.owner is hyperband
      bracket.rungs[0] = rung_0
  
      rung = bracket.rungs[0]["results"]
      trial_id = next(iter(rung.keys()))
      objective, point = rung.pop(trial_id)
  
      assert not bracket.is_filled
      assert not bracket.has_rung_filled(0)
  
      rung[trial_id] = (objective, point)
  
      assert bracket.is_filled
      assert bracket.has_rung_filled(0)
      assert not bracket.has_rung_filled(1)
      assert not bracket.has_rung_filled(2)
  
      bracket.rungs[1] = rung_1
  
      rung = bracket.rungs[1]["results"]
      trial_id = next(iter(rung.keys()))
      objective, point = rung.pop(trial_id)
  
      assert bracket.is_filled  # Should depend first rung only
      assert bracket.has_rung_filled(0)
      assert not bracket.has_rung_filled(1)
  
      rung[trial_id] = (objective, point)
  
      assert bracket.is_filled  # Should depend first rung only
      assert bracket.has_rung_filled(0)
      assert bracket.has_rung_filled(1)
      assert not bracket.has_rung_filled(2)
  
      bracket.rungs[2] = rung_2
  
      rung = bracket.rungs[2]["results"]
      trial_id = next(iter(rung.keys()))
      objective, point = rung.pop(trial_id)
  
      assert bracket.is_filled  # Should depend first rung only
      assert bracket.has_rung_filled(0)
      assert bracket.has_rung_filled(1)
      assert not bracket.has_rung_filled(2)
  
      rung[trial_id] = (objective, point)
  
      assert bracket.is_filled  # Should depend first rung only
      assert bracket.has_rung_filled(0)
      assert bracket.has_rung_filled(1)
      assert bracket.has_rung_filled(2)
  
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 15 for calling the TestHyperband obj's underlying member method code with example usage: obj.test_is_filled(hyperband, bracket, rung_0, rung_1, rung_2) without return types