Skip to content

Commit 093f148

Browse files
committed
no not treat the SequenceLearner specially
1 parent 91990fd commit 093f148

File tree

1 file changed

+5
-26
lines changed

1 file changed

+5
-26
lines changed

adaptive/tests/test_learners.py

+5-26
Original file line numberDiff line numberDiff line change
@@ -281,19 +281,9 @@ def test_adding_existing_data_is_idempotent(learner_type, f, learner_kwargs):
281281
M = random.randint(10, 30)
282282
pls = zip(*learner.ask(M))
283283
cpls = zip(*control.ask(M))
284-
if learner_type is SequenceLearner:
285-
# The SequenceLearner's points might not be hasable
286-
points, values = zip(*pls)
287-
indices, points = zip(*points)
288284

289-
cpoints, cvalues = zip(*cpls)
290-
cindices, cpoints = zip(*cpoints)
291-
assert (np.array(points) == np.array(cpoints)).all()
292-
assert values == cvalues
293-
assert indices == cindices
294-
else:
295-
# Point ordering is not defined, so compare as sets
296-
assert set(pls) == set(cpls)
285+
# Point ordering is not defined, so compare as sets
286+
assert set(pls) == set(cpls)
297287

298288

299289
# XXX: This *should* pass (https://github.com/python-adaptive/adaptive/issues/55)
@@ -324,20 +314,9 @@ def test_adding_non_chosen_data(learner_type, f, learner_kwargs):
324314
pls = zip(*learner.ask(M))
325315
cpls = zip(*control.ask(M))
326316

327-
if learner_type is SequenceLearner:
328-
# The SequenceLearner's points might not be hasable
329-
points, values = zip(*pls)
330-
indices, points = zip(*points)
331-
332-
cpoints, cvalues = zip(*cpls)
333-
cindices, cpoints = zip(*cpoints)
334-
assert (np.array(points) == np.array(cpoints)).all()
335-
assert values == cvalues
336-
assert indices == cindices
337-
else:
338-
# Point ordering within a single call to 'ask'
339-
# is not guaranteed to be the same by the API.
340-
assert set(pls) == set(cpls)
317+
# Point ordering within a single call to 'ask'
318+
# is not guaranteed to be the same by the API.
319+
assert set(pls) == set(cpls)
341320

342321

343322
@run_with(Learner1D, xfail(Learner2D), xfail(LearnerND), AverageLearner)

0 commit comments

Comments
 (0)