Skip to content

Commit 45b002f

Browse files
committed
Add test with all points failing
1 parent a247459 commit 45b002f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

sb_arch_opt/tests/algo/test_arch_sbo.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,25 @@ def test_arch_sbo_gp_failing():
196196
assert len(result.pop) == 12
197197

198198

199+
class AllFailingMueller(Mueller01):
200+
201+
def _arch_evaluate(self, x: np.ndarray, is_active_out: np.ndarray, f_out: np.ndarray, g_out: np.ndarray,
202+
h_out: np.ndarray, *args, **kwargs):
203+
super()._arch_evaluate(x, is_active_out, f_out, g_out, h_out, *args, **kwargs)
204+
f_out[:, :] = np.nan
205+
g_out[:, :] = np.nan
206+
207+
208+
@check_dependency()
209+
def test_arch_sbo_gp_all_failing():
210+
assert HAS_ARCH_SBO
211+
212+
problem = AllFailingMueller()
213+
sbo = get_arch_sbo_gp(problem, init_size=10)
214+
result = minimize(problem, sbo, termination=('n_eval', 11))
215+
assert len(result.pop) == 11
216+
217+
199218
@check_dependency()
200219
def test_arch_sbo_gp_batch(problem: ArchOptProblemBase):
201220
_, n_batch = get_default_infill(problem, n_parallel=5)

0 commit comments

Comments
 (0)