Skip to content

Commit b072a6d

Browse files
committed
use correct types in tests
1 parent 71d1d6f commit b072a6d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

adaptive/tests/test_learners.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def gaussian(n):
164164
return random.gauss(1, 1)
165165

166166

167-
@learn_with(AverageLearner1D, bounds=[-2, 2])
167+
@learn_with(AverageLearner1D, bounds=(-2, 2))
168168
def noisy_peak(
169169
seed_x,
170170
sigma: uniform(1.5, 2.5),
@@ -271,8 +271,8 @@ def test_uniform_sampling2D(learner_type, f, learner_kwargs):
271271
"learner_type, bounds",
272272
[
273273
(Learner1D, (-1, 1)),
274-
(Learner2D, [(-1, 1), (-1, 1)]),
275-
(LearnerND, [(-1, 1), (-1, 1), (-1, 1)]),
274+
(Learner2D, ((-1, 1), (-1, 1))),
275+
(LearnerND, ((-1, 1), (-1, 1), (-1, 1))),
276276
],
277277
)
278278
def test_learner_accepts_lists(learner_type, bounds):
@@ -480,7 +480,9 @@ def test_learner_performance_is_invariant_under_scaling(
480480
yscale = 1000 * random.random()
481481

482482
l_kwargs = dict(learner_kwargs)
483-
l_kwargs["bounds"] = xscale * np.array(l_kwargs["bounds"])
483+
bounds = xscale * np.array(l_kwargs["bounds"])
484+
bounds = tuple((bounds).tolist()) # to satisfy typeguard tests
485+
l_kwargs["bounds"] = bounds
484486

485487
def scale_x(x):
486488
if isinstance(learner, AverageLearner1D):

0 commit comments

Comments
 (0)