MCPcopy Index your code
hub / github.com/bayesian-optimization/BayesianOptimization / test_print_header

Function test_print_header

tests/test_logger.py:172–191  ·  view source on GitHub ↗

Test the _print_header method.

()

Source from the content-addressed store, hash-verified

170
171
172def test_print_header():
173 """Test the _print_header method."""
174 optimizer = BayesianOptimization(target_func, PBOUNDS, random_state=1)
175 logger = ScreenLogger()
176
177 header_str = logger._print_header(optimizer._space.keys)
178
179 # Check if header contains expected column names
180 assert "iter" in header_str
181 assert "target" in header_str
182 assert "p1" in header_str
183 assert "p2" in header_str
184
185 # Check if divider line is included
186 assert "-" * 10 in header_str
187
188 # Check with constrained logger
189 constrained_logger = ScreenLogger(is_constrained=True)
190 constrained_header = constrained_logger._print_header(optimizer._space.keys)
191 assert "allowed" in constrained_header
192
193
194def test_is_new_max():

Callers

nothing calls this directly

Calls 3

_print_headerMethod · 0.95
ScreenLoggerClass · 0.90

Tested by

no test coverage detected