Skip to content

Commit c65c10c

Browse files
committed
rename '_pending' to 'pending_points' in the 'LearnerND' for code homogeneity
1 parent 381cedb commit c65c10c

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

adaptive/learner/learnerND.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def __init__(self, func, bounds, loss_per_simplex=None):
161161
self.loss_per_simplex = loss_per_simplex or default_loss
162162
self.bounds = tuple(tuple(map(float, b)) for b in bounds)
163163
self.data = OrderedDict()
164-
self._pending = set()
164+
self.pending_points = set()
165165

166166
self._bounds_points = list(map(tuple, itertools.product(*bounds)))
167167

@@ -247,7 +247,7 @@ def tell(self, point, value):
247247
if value is None:
248248
return self.tell_pending(point)
249249

250-
self._pending.discard(point)
250+
self.pending_points.discard(point)
251251
tri = self.tri
252252
self.data[point] = value
253253

@@ -274,7 +274,7 @@ def tell_pending(self, point, *, simplex=None):
274274
if not self.inside_bounds(point):
275275
return
276276

277-
self._pending.add(point)
277+
self.pending_points.add(point)
278278

279279
if self.tri is None:
280280
return
@@ -333,7 +333,7 @@ def ask(self, n, tell_pending=True):
333333
def _ask_bound_point(self):
334334
# get the next bound point that is still available
335335
new_point = next(p for p in self._bounds_points
336-
if p not in self.data and p not in self._pending)
336+
if p not in self.data and p not in self.pending_points)
337337
self.tell_pending(new_point)
338338
return new_point, np.inf
339339

@@ -394,7 +394,7 @@ def _ask_best_point(self):
394394

395395
@property
396396
def _bounds_available(self):
397-
return any((p not in self._pending and p not in self.data)
397+
return any((p not in self.pending_points and p not in self.data)
398398
for p in self._bounds_points)
399399

400400
def _ask(self):
@@ -459,7 +459,7 @@ def loss(self, real=True):
459459

460460
def remove_unfinished(self):
461461
# XXX: implement this method
462-
self._pending = set()
462+
self.pending_points = set()
463463
self._subtriangulations = dict()
464464
self._pending_to_simplex = dict()
465465

0 commit comments

Comments
 (0)