Skip to content

Commit 07f24b9

Browse files
committed
add a test to ask for 0 points
1 parent 717557e commit 07f24b9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

adaptive/tests/test_balancing_learner.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ def test_distribute_first_points_over_learners():
3434
assert len(set(i_learner)) == len(learners)
3535

3636

37+
def test_ask_0():
38+
for strategy in ['loss', 'loss_improvements', 'npoints']:
39+
learners = [Learner1D(lambda x: x, bounds=(-1, 1)) for i in range(10)]
40+
learner = BalancingLearner(learners, strategy=strategy)
41+
points, _ = learner.ask(0)
42+
assert len(points) == 0
43+
44+
3745
def test_strategies():
3846
goals = {
3947
'loss': lambda l: l.loss() < 0.1,

0 commit comments

Comments
 (0)