Skip to content

Commit 4339e65

Browse files
committed
Make anisotropic keyword-only in LearnerND
1 parent 94214ca commit 4339e65

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

adaptive/learner/learnerND.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ class LearnerND(BaseLearner):
308308
children based on volume.
309309
"""
310310

311-
def __init__(self, func, bounds, loss_per_simplex=None, anisotropic=False):
311+
def __init__(self, func, bounds, loss_per_simplex=None, *, anisotropic=False):
312312
self._vdim = None
313313
self.loss_per_simplex = loss_per_simplex or default_loss
314314

adaptive/tests/unit/test_learnernd.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ def test_learnerND_accepts_ConvexHull_as_input():
3434
assert np.allclose(learner._bbox, [(0, 2), (0, 1)])
3535

3636

37+
def test_learnerND_anisotropic_is_keyword_only():
38+
with pytest.raises(TypeError):
39+
LearnerND(ring_of_fire, [(-1, 1), (-1, 1)], None, True)
40+
41+
3742
def test_learnerND_raises_if_too_many_neigbors():
3843
@uses_nth_neighbors(2)
3944
def loss(*args):

0 commit comments

Comments
 (0)