Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
run pre-commit
  • Loading branch information
basnijholt committed Oct 1, 2025
commit cf12afbcb160f4bed538cb13fe596c8a36927bb4
4 changes: 3 additions & 1 deletion adaptive/learner/learnerND.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,9 @@ def _is_known_point(self, point):
]

def _close(other):
return all(abs(a - b) <= tol for (a, b, tol) in zip(point, other, tolerances))
return all(
abs(a - b) <= tol for (a, b, tol) in zip(point, other, tolerances)
)

for existing in self.data.keys():
if _close(existing):
Expand Down
9 changes: 6 additions & 3 deletions adaptive/tests/unit/test_learnernd_integration.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import math

import pytest
import numpy as np
import pytest
from scipy.spatial import ConvexHull

from adaptive.learner import LearnerND
Expand Down Expand Up @@ -60,9 +60,10 @@ def test_learnerND_log_works():

@pytest.mark.skipif(not with_pandas, reason="pandas is not installed")
def test_learnerND_resume_after_loading_dataframe_convex_hull(monkeypatch):
import pandas
from types import MethodType

import pandas

hull_points = [
(4.375872112626925, 8.917730007820797),
(4.236547993389047, 6.458941130666561),
Expand Down Expand Up @@ -98,7 +99,9 @@ def some_f(xy):

def old_ask_bound_point(self):
new_point = next(
p for p in self._bounds_points if p not in self.data and p not in self.pending_points
p
for p in self._bounds_points
if p not in self.data and p not in self.pending_points
)
self.tell_pending(new_point)
return new_point, np.inf
Expand Down
Loading